How to Set Up a Linux VPS for Beginners
Getting your first VPS can feel intimidating. You have a blank Linux server and a terminal and now you are wondering what to do next. This guide walks you through everything you need to get your VPS set up, secured, and ready to use.
Step 1: Connect via SSH
After your VPS is provisioned you will receive an email with your server IP address, username, and password. Open a terminal and run:
ssh username@your-server-ip
The first time you connect you will see a message asking you to confirm the server fingerprint. Type yes and press Enter.
Step 2: Update Your Server
Always update all packages first to get the latest security patches:
sudo apt update && sudo apt upgrade -y
Step 3: Create a New User
Running everything as root is a security risk. Create a new user with sudo privileges:
adduser yourname
usermod -aG sudo yourname
Step 4: Set Up SSH Keys
On your local machine, generate an SSH key pair:
ssh-keygen -t ed25519 -C "[email protected]"
Then copy your public key to the server:
ssh-copy-id yourname@your-server-ip
Step 5: Configure the Firewall
sudo ufw allow OpenSSH
sudo ufw allow 80
sudo ufw allow 443
sudo ufw enable
Step 6: Disable Root Login
Edit the SSH config:
sudo nano /etc/ssh/sshd_config
Change PermitRootLogin yes to PermitRootLogin no, then restart SSH:
sudo systemctl restart ssh
Step 7: Install What You Need
Nginx Web Server
sudo apt install nginx -y
sudo systemctl enable nginx
sudo systemctl start nginx
Node.js
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install nodejs -y
Docker
curl -fsSL https://get.docker.com | sudo sh
Step 8: Install SSL with Let's Encrypt
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d yourdomain.com
Common Beginner Mistakes to Avoid
- Running everything as root
- Leaving the firewall disabled
- Using weak passwords instead of SSH keys
- Not taking backups
- Ignoring security updates
Need a VPS to practice on?
Galaxy Cloud Solutions offers Ubuntu, Debian, Rocky Linux, and AlmaLinux VPS plans starting at $5/month with full root SSH access and instant deployment.
Get Your First VPS — Use Code LAUNCH2026