VPS SETUP
Jun 23/2026

Initial Server Setup on Ubuntu 24.04: A Step-by-Step Checklist

9 min read
Author
CloudStick Team
Server Infrastructure
Share this article
Initial Server Setup on Ubuntu 24.04: A Step-by-Step Checklist
CloudStick
Ubuntu 24.04
server checklist

Step 1: Create a Non-Root Sudo User

Working as root is dangerous — a single mistyped command can wipe your server. The first thing to do after first login is create a regular user with sudo privileges. This user will be your day-to-day account for all server operations.

# Create the new user (replace "deploy" with your preferred username)
adduser deploy
# Add to the sudo group
usermod -aG sudo deploy
# Switch to the new user to verify
su - deploy
# Confirm sudo works
sudo whoami
# Should output: root

Now that you have a sudo user, all privileged commands go through sudo — which logs them and forces a password confirmation.

Step 2: Set Up SSH Key Authentication

Password-based SSH logins are vulnerable to brute-force attacks. SSH key authentication eliminates that risk because an attacker would need your private key file, not just a guessable password.

# On your LOCAL machine, generate an ED25519 key pair
ssh-keygen -t ed25519 -C "deploy@yourserver"
# Copy your public key to the server
ssh-copy-id -i ~/.ssh/id_ed25519.pub deploy@YOUR_SERVER_IP
# Test key-based login
ssh deploy@YOUR_SERVER_IP
# Once confirmed, disable password auth
sudo sed -i 's/^#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
sudo systemctl restart ssh
PREREQUISITE

Run ssh-copy-id from your local machine before disabling password auth. If you lock yourself out, you will need to use your cloud provider's console (serial console or rescue mode) to recover.

Step 3: Enable UFW Firewall

Ubuntu 24.04 ships with UFW available but inactive. Three rules cover the vast majority of production servers: allow SSH, HTTP, and HTTPS — block everything else.

sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw status verbose

If you run additional services (MySQL on 3306, Redis on 6379), add allow rules only for trusted source IPs: sudo ufw allow from TRUSTED_IP to any port 3306.

Step 4: Enable Automatic Security Updates

Security vulnerabilities in system packages are discovered constantly. Unattended-upgrades applies security patches automatically, so your server stays protected even if you forget to run apt upgrade manually.

sudo apt install unattended-upgrades -y
sudo dpkg-reconfigure --priority=low unattended-upgrades
# Verify the service is running
sudo systemctl status unattended-upgrades
TIP

Edit /etc/apt/apt.conf.d/50unattended-upgrades to configure automatic reboots during a maintenance window. Set Unattended-Upgrade::Automatic-Reboot-Time to "03:00" and Unattended-Upgrade::Automatic-Reboot to "true".

Step 5: Sync the System Clock

Correct server time matters for SSL certificate validation, log timestamps, cron jobs, and authentication protocols like JWT and OAuth. Ubuntu 24.04 uses systemd-timesyncd for NTP sync by default, but you should verify it is active and configured correctly.

# Check current time sync status
timedatectl status
# Set timezone to UTC (recommended for production servers)
sudo timedatectl set-timezone UTC
# Confirm NTP is active
sudo timedatectl set-ntp true
timedatectl show --property=NTPSynchronized

Step 6: Connect CloudStick as Your Management Layer

All of the above steps harden the OS layer. CloudStick sits on top of that as a web-based management layer — handling site creation, SSL, PHP version switching, backup scheduling, firewall rules, and team access without requiring you to SSH in again.

From your CloudStick dashboard, click “+ Add Server” → “Connect Your Own Server”. Copy the one-line bash command and run it on your server as the sudo user. The installation takes under two minutes. CloudStick's Sudo & System User Management section in the dashboard mirrors what you set up in Step 1, letting you manage users and permissions without a command line.

Leave a comment
Full Name
Email Address
Message
Contents

We use cookies to improve your experience

CloudStick uses cookies to personalise content, analyse traffic and keep you signed in. Cookie Policy · Terms of Service

Manage cookies