Cara Setup VPS Ubuntu 24.04 untuk Web Application

Cara Setup VPS Ubuntu 24.04 untuk Web Application

Login Awal ke VPS

Akses VPS menggunakan SSH:

ssh root@IP_VPS

Login sebagai root hanya digunakan untuk konfigurasi awal server.

Update Sistem Operasi

Perbarui sistem agar menggunakan paket terbaru:

apt update && apt upgrade -y

Langkah ini penting untuk memastikan:

  • Patch keamanan terbaru
  • Stabilitas sistem
  • Kompatibilitas dependency di tahap berikutnya

Instalasi Paket Dasar

Install paket dasar yang umum dibutuhkan di server production:

apt install -y \
  curl \
  wget \
  git \
  ca-certificates \
  gnupg \
  lsb-release

Membuat User Non-Root

Untuk alasan keamanan, aktivitas production tidak dijalankan menggunakan user root.

adduser hame
usermod -aG sudo hame

Konfigurasi Akses SSH untuk User Baru

rsync --archive --chown=hame:hame ~/.ssh /home/hame
ssh hame@IP_VPS

Struktur Direktori Production

mkdir -p ~/apps ~/logs ~/backups


/home/hame/
├── apps/
├── logs/
└── backups/

Verifikasi

Server siap digunakan jika:

  • Sistem ter-update
  • User non-root aktif
  • SSH key berfungsi
  • Struktur direktori tersedia

Related Posts

Comments (0)

Please login to post a comment

No comments yet. Be the first to share your thoughts!

Ilham Shofa

creativity is just connecting things. - Steve Jobs

ilhameid.© 2026