supabase

✅ Cara Install Supabase di Ubuntu 22.04 Menggunakan Shell Script

April 23, 2025 Updated: April 23, 2025
✅ Cara Install Supabase di Ubuntu 22.04 Menggunakan Shell Script

Supabase adalah alternatif open-source dari Firebase yang mudah di-deploy secara lokal. Pada artikel ini, kamu akan belajar cara install Supabase di Ubuntu 22.04 menggunakan script install.sh.

⚠️ Penting: Tutorial ini hanya didesain untuk Ubuntu 22.04. Versi Ubuntu lainnya mungkin tidak kompatibel.

🧑‍💻 Langkah-Langkah Install Supabase di Ubuntu 22.04

1. Buat File Installasi

Buka terminal dan jalankan perintah:

nano install.sh

2. Salin Perintah Berikut ke Dalam install.sh

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo \"$VERSION_CODENAME\") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

# Install Docker and its plugins
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y

# Get the Supabase repo
git clone --depth 1 https://github.com/supabase/supabase

# Masuk ke folder docker
cd supabase/docker

# Copy file environment
cp .env.example .env

# Pull image Supabase terbaru
docker compose pull

# Jalankan Supabase secara background
docker compose up -d

# Cek status container
docker compose ps

# Optional: copy anon key ke clipboard
sudo apt install xclip -y
PUBLIC_IP=$(curl -s ifconfig.me) && ANON_KEY=$(grep ANON_KEY .env | cut -d '=' -f2) && echo "ANON_KEY: $ANON_KEY" && echo "http://$PUBLIC_IP:8000" && echo -n "$ANON_KEY" | xclip -selection clipboard

# Info akses
echo "1. Access the dashboard at http://localhost:8000"
echo "2. Don't forget to open the ports in your firewall"
echo "3. Default username is: supabase"
echo "4. Default password is: this_password_is_insecure_and_should_be_updated"
echo "5. your url is: http://localhost:8000"
echo "6. your anon key can be found on nano docker/.env"
echo "7. SET ENABLE_EMAIL_AUTOCONFIRM=true at docker/.env"

# Optional command
echo "Stop and remove the containers"
echo "docker compose down"

echo "Recreate and start the containers"
echo "docker compose up -d"

3. Simpan dan Tutup File

Tekan CTRL + O lalu Enter, lalu tekan CTRL + X untuk keluar.

4. Jalankan Script Install

Jalankan perintah berikut di terminal:

sh install.sh

📌 Tips Tambahan

sudo ufw allow 8000

📂 Kategori

🔖 Tags

#supabase #ubuntu2204 #selfhosted #docker #postgresql #firebasealternative #openSource

Back to Blogs