Deploy Website ke Vercel dalam 5 Menit (Gratis)
Step-by-step deploy website ke Vercel gratis. Cover: GitHub integration, custom domain, SSL, dan tips optimasi performa. Cocok untuk portfolio dan landing page.
Mengapa Vercel?
Vercel adalah platform deploy yang paling developer-friendly untuk website statis dan Next.js. Gratis untuk penggunaan personal dengan bandwidth 100GB/bulan, SSL otomatis, dan global CDN. Cocok untuk portfolio, landing page, dan company profile.
| Fitur | Vercel Free | Shared Hosting |
|---|---|---|
| Harga | Rp 0 | Rp 50-150rb/bulan |
| SSL | Auto (Let's Encrypt) | Kadang manual |
| CDN | Global edge | Server lokasi saja |
| Deploy | Git push = live | FTP manual |
| Speed | <1 detik TTFB | 1-3 detik |
| Custom domain | Gratis | Tergantung paket |
Step 1: Push ke GitHub
Buat repo baru di GitHub, lalu push kode website kamu:
# Inisialisasi git di folder project
git init
git add .
git commit -m "initial deploy"
# Push ke GitHub
git remote add origin https://github.com/username/my-website.git
git push -u origin main
Step 2: Hubungkan ke Vercel
- Buka vercel.com dan login dengan GitHub
- Klik "Add New Project"
- Pilih repo yang baru kamu push
- Klik "Deploy" — tunggu 30-60 detik
- Selesai! Website kamu live di
my-website.vercel.app
Step 3: Custom Domain
Kalau punya domain sendiri (misal: bisnis.com):
- Di Vercel dashboard → Settings → Domains
- Ketik domain kamu → klik "Add"
- Vercel kasih DNS record yang perlu ditambah
- Buka panel DNS domain kamu (Cloudflare/Domainesia/dll)
- Tambahkan CNAME record:
www → cname.vercel-dns.com - Tambahkan A record:
@ → 76.76.21.21 - Tunggu 5-30 menit untuk propagasi DNS
Step 4: Auto-Deploy dari Git
Fitur terbaik Vercel: setiap kali kamu git push, website otomatis update. Tidak perlu FTP, tidak perlu build manual.
# Ubah file, commit, push — website langsung update
git add .
git commit -m "update: tambah halaman kontak"
git push
Vercel juga bikin preview deployment untuk setiap branch — cocok untuk testing sebelum merge ke main.
Pitfall Umum
1. cleanUrls dan Path Relatif
Kalau aktifkan cleanUrls di vercel.json, path relatif CSS/JS bisa break. Solusi: gunakan absolute path (/css/style.css) bukan relative (../css/style.css).
2. 404 pada Refresh
SPA (Single Page Application) perlu rewrite rule:
// vercel.json
{
"rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
}
3. Environment Variables
Kalau butuh API key atau secret, tambah di Settings → Environment Variables. Jangan pernah hardcode di kode yang di-push ke GitHub.
Performance Tips
- Kompres gambar ke WebP (80% lebih kecil dari PNG)
- Gunakan
loading="lazy"pada gambar - Minify CSS/JS (Vercel auto-minify untuk Next.js)
- Hapus unused CSS (purgecss untuk Tailwind)
- Preload font:
<link rel="preload" as="font">
Butuh Website Profesional?
LYID Web Dev bikin website modern, cepat, dan SEO-friendly untuk bisnis kamu. Mulai dari Rp 1.5jt.
Chat via WhatsApp Lihat Portofolio →