Ubuntu 24.04 Server Setup: Complete Configuration Guide (2026)
Setting up an ubuntu 24.04 server setup correctly from the start is crucial for security, performance, and long-term maintainability. This comprehensive guide walks you through the complete ubuntu 24.04 server setup process, from installation to hardening, covering networking, SSH configuration, firewall rules, and essential services. Whether you’re deploying on bare metal, a VPS, or cloud infrastructure, this ubuntu 24.04 server setup tutorial ensures you follow current best practices for 2026.
Prerequisites for Ubuntu 24.04 Server Setup
Before beginning your ubuntu 24.04 server setup, verify these minimum hardware requirements:
- CPU: 2 cores minimum (4+ recommended for production)
- RAM: 2 GB minimum (4 GB+ recommended)
- Storage: 10-20 GB minimum (SSD preferred)
- Network: Stable internet connection
Download the official Ubuntu 24.04 LTS ISO from ubuntu.com/download/server (ubuntu-24.04-live-server-amd64.iso). For cloud deployments like DigitalOcean or AWS, select Ubuntu 24.04 LTS from the distribution menu.
Step 1: Installing Ubuntu 24.04 Server
The ubuntu 24.04 server setup installation uses a text-based installer that guides you through essential configuration choices:
Boot and Language Selection
Boot from your installation media (USB or ISO). Select your preferred language and keyboard layout. The installer will auto-detect network interfaces and attempt DHCP configuration.
Network Configuration
For static IP configuration during ubuntu 24.04 server setup, you can configure this later via Netplan, but DHCP works fine for initial installation. Production servers typically require static IPs, which we’ll configure in Step 3.
Storage Configuration
Choose between guided (entire disk), LVM (recommended for flexibility), or manual partitioning. A standard ubuntu 24.04 server setup partition scheme includes:
- EFI System Partition: 512 MB (FAT32) for UEFI boot
- Root Partition: Remaining space (ext4)
- Swap: Swap file (2-4 GB, configured post-install)
LVM provides snapshot capabilities and easier disk management for professional ubuntu 24.04 server setup scenarios.
Profile and SSH Setup
Create your primary administrative user (avoid username “root”). Enable OpenSSH server during installation to allow remote access immediately after your ubuntu 24.04 server setup completes. If you have SSH public keys, import them now for passwordless authentication.
Featured Server Snaps
Skip optional snaps during installation—install services manually after your base ubuntu 24.04 server setup is complete and secured.
Step 2: Initial System Update
After rebooting into your new ubuntu 24.04 server setup, perform an immediate system update:
1
2
3 sudo apt update
sudo apt upgrade -y
sudo apt autoremove -y
This ensures all packages are current with the latest security patches. For automated updates, consider configuring
1 | unattended-upgrades |
:
1
2 sudo apt install unattended-upgrades -y
sudo dpkg-reconfigure --priority=low unattended-upgrades
Automatic security updates are essential for production ubuntu 24.04 server setup environments.
Step 3: Network Configuration with Netplan
Ubuntu 24.04 uses Netplan for network configuration. Static IP configuration is critical for server infrastructure. Edit the Netplan configuration file:
1 sudo nano /etc/netplan/01-netcfg.yaml
Replace with this static IP configuration (adjust for your network):
1
2
3
4
5
6
7
8
9
10
11
12
13
14 network:
version: 2
ethernets:
eth0:
dhcp4: no
addresses:
- 192.168.1.50/24
routes:
- to: default
via: 192.168.1.1
nameservers:
addresses:
- 1.1.1.1
- 8.8.8.8
Apply the configuration:
1 sudo netplan apply
Verify connectivity with
1 | ip a |
and
1 | ping 8.8.8.8 |
. Proper network configuration is foundational to any robust ubuntu 24.04 server setup.
Step 4: SSH Hardening and Key-Based Authentication
SSH security is paramount in modern ubuntu 24.04 server setup practices. First, ensure SSH is installed and running:
1
2 sudo systemctl status ssh
sudo systemctl enable ssh
Configure SSH Key Authentication
On your local machine, generate an SSH key pair if you haven’t already:
1 ssh-keygen -t ed25519 -C "[email protected]"
Copy the public key to your server:
1 ssh-copy-id username@server_ip
Test key-based login, then harden the SSH configuration:
1 sudo nano /etc/ssh/sshd_config
Set these security parameters:
1
2
3
4
5
6
7 PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
X11Forwarding no
MaxAuthTries 3
ClientAliveInterval 300
ClientAliveCountMax 2
Reload SSH to apply changes:
1 sudo systemctl reload sshd
Important: Test SSH access in a new terminal before closing your current session to avoid lockouts during ubuntu 24.04 server setup.
Step 5: Firewall Configuration with UFW
Ubuntu’s Uncomplicated Firewall (UFW) simplifies firewall management. Configure it as part of your ubuntu 24.04 server setup:
1
2
3
4 sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow OpenSSH
sudo ufw enable
Check status:
1 sudo ufw status verbose
Add additional rules as needed (e.g., for web servers):
1
2 sudo ufw allow 'Nginx Full'
sudo ufw allow 443/tcp
UFW provides essential perimeter security for any professional ubuntu 24.04 server setup. Review rules regularly and follow the principle of least privilege.
Step 6: Intrusion Prevention with Fail2Ban
Fail2Ban monitors logs and bans IPs showing malicious behavior. Install and configure it:
1
2
3 sudo apt install fail2ban -y
sudo systemctl enable fail2ban
sudo systemctl start fail2ban
Create a local configuration:
1
2 sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
sudo nano /etc/fail2ban/jail.local
Enable SSH protection:
1
2
3
4
5
6 [sshd]
enabled = true
port = ssh
logpath = /var/log/auth.log
maxretry = 3
bantime = 3600
Restart Fail2Ban:
1 sudo systemctl restart fail2ban
Monitor banned IPs:
1 sudo fail2ban-client status sshd
Fail2Ban adds critical runtime protection to your ubuntu 24.04 server setup against brute-force attacks.
Step 7: Installing Essential Services
With the secure foundation of your ubuntu 24.04 server setup complete, you can now install application services.
Web Server (Nginx)
1
2
3 sudo apt install nginx -y
sudo systemctl enable nginx
sudo systemctl start nginx
Test by accessing your server IP in a browser. Remember to allow Nginx through UFW as shown in Step 5.
Database (PostgreSQL)
1
2
3 sudo apt install postgresql postgresql-contrib -y
sudo systemctl enable postgresql
sudo systemctl start postgresql
Monitoring Tools
Install system monitoring utilities:
1 sudo apt install htop iotop nethogs -y
For comprehensive monitoring in production ubuntu 24.04 server setup environments, consider Prometheus with Grafana, or cloud-native solutions.
Step 8: Time Synchronization
Accurate time is critical for logs, certificates, and distributed systems. Configure systemd-timesyncd (default) or chrony:
1
2
3 sudo timedatectl set-timezone Europe/Berlin
sudo timedatectl set-ntp true
timedatectl status
For servers requiring high precision, install chrony:
1 sudo apt install chrony -y
Time synchronization prevents authentication issues and ensures correct log timestamps in your ubuntu 24.04 server setup.
Step 9: System Hardening Best Practices
Apply these additional hardening measures to your ubuntu 24.04 server setup:
Disable Unused Services
1
2 systemctl list-unit-files --state=enabled
sudo systemctl disable [unused-service]
Configure Automatic Security Updates
We configured this in Step 2, but verify it’s active:
1 sudo systemctl status unattended-upgrades
Implement Log Monitoring
Regularly review system logs:
1
2 sudo journalctl -xe
sudo tail -f /var/log/auth.log
For centralized logging, consider shipping logs to ELK Stack or a cloud logging service.
Set Up Backup Strategy
No ubuntu 24.04 server setup is complete without backups. Use tools like:
- rsync for file-level backups
- Restic for encrypted, deduplicated backups
- LVM snapshots for system-level backups
1 sudo apt install restic -y
Test restore procedures regularly—untested backups are not backups.
Step 10: Documentation and Maintenance
Document your ubuntu 24.04 server setup thoroughly:
- Network configuration and firewall rules
- Installed services and their configurations
- User accounts and SSH key locations
- Backup schedules and restore procedures
- Update and maintenance windows
Create a maintenance checklist:
1
2
3
4
5
6
7
8
9
10 # Weekly
- Review system logs
- Check disk usage (df -h)
- Verify backup completion
# Monthly
- Review user accounts
- Update documentation
- Test backup restore
- Security audit
Troubleshooting Common Ubuntu 24.04 Server Setup Issues
Network Not Working After Static IP Configuration
Verify Netplan syntax with
1 | sudo netplan try |
(auto-reverts after 120 seconds if you lose connection). Check interface names with
1 | ip link |
.
SSH Connection Refused
Verify SSH is running:
1 | sudo systemctl status ssh |
. Check firewall:
1 | sudo ufw status |
. Review logs:
1 | sudo journalctl -u ssh |
.
Apt Update Fails
Check DNS configuration in
1 | /etc/netplan/ |
. Test DNS:
1 | nslookup ubuntu.com |
. Try different nameservers (1.1.1.1, 8.8.8.8, 9.9.9.9).
Conclusion
This comprehensive ubuntu 24.04 server setup guide has walked you through installation, networking, SSH hardening, firewall configuration, intrusion prevention, and essential services. By following these 2026 best practices, you’ve established a secure, maintainable foundation for production workloads.
Remember that server security is an ongoing process, not a one-time setup. Schedule regular security audits, keep systems updated, monitor logs actively, and document all changes to your ubuntu 24.04 server setup.
For advanced configurations like clustering, container orchestration with Kubernetes, or high-availability setups, build upon this solid ubuntu 24.04 server setup foundation. The principles of least privilege, defense in depth, and infrastructure as code apply regardless of complexity.
Continue learning about Ubuntu server administration through the official Ubuntu Server documentation and stay current with security advisories through Ubuntu Security Notices.
- About the Author
- Latest Posts
Mark is a senior content editor at Text-Center.com and has more than 20 years of experience with linux and windows operating systems. He also writes for Biteno.com