Tutorials

Ubuntu Server Setup Guide for Beginners in 2026

A fresh Linux VPS may look ready to use immediately, but skipping the initial security configuration can expose your system to unnecessary risks. A proper Ubuntu Server Setup helps secure remote access, protect services, and prepare the server for production workloads.

This guide explains the essential first steps after deploying an Ubuntu 26.04 server, including creating a sudo user, configuring SSH keys, enabling the firewall, and updating the system safely.

Connect to Your Ubuntu Server

The first login usually happens through the root account provided by your hosting company. Connect to the server using SSH from your local machine:

ssh root@server_ip_address

After entering the password or using your SSH key, you will gain full administrative access to the system.

Create a Secure Sudo User

Using the root account daily is not recommended because every command has unrestricted system privileges. Instead, create a dedicated user account for administration.

Add a new user:

adduser username

Grant administrative access:

usermod -aG sudo username

This allows the account to execute administrative commands using sudo.

Ubuntu Server Setup with SSH Keys

SSH key authentication provides stronger security than passwords and helps prevent brute-force attacks.

If you already have SSH keys on your local system, copy them to the server:

ssh-copy-id username@server_ip_address

Now test the connection using the new account:

ssh username@server_ip_address

Successful login confirms the SSH configuration is working properly.

Disable Root Login and Password Authentication

Once SSH keys are configured, harden your server by disabling direct root access and password authentication.

Create a custom SSH configuration file:

sudo nano /etc/ssh/sshd_config.d/99-hardening.conf

Add the following lines:

PermitRootLogin no
PasswordAuthentication no

Verify the SSH syntax:

sudo sshd -t

Reload the SSH service:

sudo systemctl reload ssh

These changes significantly improve server security.

Configure the Firewall Using UFW

Ubuntu includes UFW (Uncomplicated Firewall), which simplifies firewall management.

Allow SSH traffic first:

sudo ufw allow OpenSSH

Enable the firewall:

sudo ufw enable

Check active firewall rules:

sudo ufw status

If you later install web servers like Nginx or Apache, additional firewall rules may be required.

Set Hostname and Timezone

A proper hostname helps identify servers quickly in logs and monitoring systems.

Set the hostname:

sudo hostnamectl set-hostname web-server

Configure your timezone:

sudo timedatectl set-timezone Asia/Kolkata

Correct timezone settings improve scheduling accuracy for logs and cron jobs.

Update Ubuntu Packages

Keeping packages updated is one of the most important security practices.

Refresh repositories and install updates:

sudo apt update
sudo apt upgrade

If the update installs a new kernel, reboot the server:

sudo reboot

Final Thoughts

Completing a proper Ubuntu Server Setup ensures your VPS starts with strong security, safer SSH access, firewall protection, and updated software packages. These initial steps create a solid foundation before deploying websites, databases, containers, or production applications on Ubuntu 26.04.

Cyber Defence

Recent Posts

How to Install LEMP Stack on Ubuntu 26.04 for Beginners

If you want to host dynamic PHP websites or applications like WordPress, Laravel, or Magento,…

3 hours ago

How to Install Java on Ubuntu 24.04 Easily in 2026

Java remains one of the most widely used programming platforms for servers, enterprise applications, Android…

1 week ago

How to Install DEB Files on Ubuntu in 2026 (Step-by-Step Beginner Guide)

Ubuntu users often download software directly from developer websites instead of using the default app…

1 week ago

Things to Do After Installing Ubuntu 26.04 LTS for a Fast, Secure Setup

Installing Ubuntu 26.04 LTS is only the first step toward building a smooth, secure, and…

2 weeks ago

How to Prevent Software Supply Chain Attacks

What is a Software Supply Chain Attack? A software supply chain attack occurs when a…

2 months ago

How UDP Works and Why It Is So Fast

When people ask how UDP works, the simplest answer is this: UDP sends data quickly…

2 months ago