- Ubuntu Server offers a stable, secure, and free platform for hosting websites, applications, databases, and network services in physical, virtual, or cloud environments.
- LTS versions, the UFW firewall, SSH key authentication, and regular updates help strengthen the server's security and reliability in the long term.
- The large community, abundant documentation, and ease of installing software such as Docker, NGINX, Apache, or VNC make Ubuntu Server a very flexible and adaptable solution.
- With good disk planning, backups, and security audits using tools like Lynis, it's possible to keep Ubuntu servers optimized, protected, and ready to grow.

Setting up a server with Ubuntu Server has become a favorite option for both personal projects and professional environments. It's stable, secure, free, and highly flexible, making it perfect for hosting websites, applications, databases, or even entire cloud infrastructures without spending a fortune on licenses.
In this guide, you'll find everything you need to understand, install, secure, and optimize Ubuntu Server on a VPS, dedicated server, or virtualized environment. We'll cover exactly what Ubuntu Server is, its advantages over other distributions , system requirements, initial installation and configuration, SSH usage, firewalls, backups, installation of key software (Apache, NGINX, Docker, VNC, etc.), and some optimization and troubleshooting tips that will save you a lot of trouble.
What is Ubuntu Server and why is it used so much on servers?
Ubuntu Server is a server-specific edition of Ubuntu , based on the Linux kernel and maintained by Canonical. Unlike Ubuntu Desktop, it does not include a graphical environment and is almost always managed from the command line or using remote administration tools.
This lack of a graphical interface means it consumes fewer resources and is more efficient for tasks such as hosting websites, managing databases, providing network services ( DNS , DHCP, email, files, etc.) or deploying applications in containers and in the cloud.
The name “Ubuntu” itself comes from an African philosophy meaning something like “I am because we are ,” which perfectly aligns with the idea of community and open-source software. Since its first version in 2004, Ubuntu has steadily gained ground, becoming one of the most widely used Linux distributions, and its server edition is now a de facto standard in many data centers, public clouds, and enterprise projects.
One of the strengths of Ubuntu Server is its release model with LTS (Long Term Support) versions , which offer extended support and security updates for several years, giving peace of mind to system administrators and developers looking for stability.

Advantages of using an Ubuntu server
One of the biggest reasons to choose Ubuntu Server is that it's free and open-source software : you don't pay any license fees or subscription costs to use it on your VPS, VDS, or dedicated server. This reduces IT costs, especially when scaling to multiple servers or a full cluster.
Ubuntu offers regular updates and LTS versions (such as 20.04, 22.04, or 24.04) with security patches for years. This allows you to keep your server protected against known vulnerabilities without constantly migrating your operating system.
The Ubuntu community is huge, and that translates into active forums, official documentation, tutorials and guides for practically anything you want to do: from setting up a simple web server to building a complex infrastructure with containers and high availability.
On a technical level, Ubuntu Server works very well with a wide variety of hardware and software , from small VPSs to large dedicated servers, including cloud services like AWS, Azure, and Google Cloud. Furthermore, it's very container- and cloud-oriented, with native support for Docker, Kubernetes, and similar tools.
Another important point is flexibility and customization : you can install only the packages and services you need (for example, just NGINX and Docker, or a classic LAMP stack with Apache, MySQL and PHP), avoiding unnecessary services that only consume resources and increase the attack surface.
Hardware requirements for Ubuntu Server and disk planning
Ubuntu Server 24.04 LTS and similar versions have fairly modest hardware requirements , making them suitable for use on virtual machines or budget servers. As a general guideline, a 1 GHz x86-64 CPU, 1 GB of RAM (2 GB is better for more flexibility), and around 10 GB of storage are generally recommended for typical use.
In virtualization environments such as VMware, Proxmox or Hyper-V, the requirements are very similar , although in practice you will have to size CPU, RAM and disk according to the actual load of your applications, databases and containers.
During installation, the wizard will ask if you want to use a single full disk or multiple partitions . In most cases, the recommended option is to let Ubuntu use the entire disk and create the necessary partitions. Even if you choose a single "large" volume, the installer will internally create smaller partitions for the system , bootloader, and other critical components.
Later on, if you need to adjust space, you can use disk management commands like df -h to check partition usage, or tools like resize2fs (along with the corresponding partition management) to extend file systems on devices like /dev/sdXY.
Download and basic installation of Ubuntu Server
To begin, the first step is to download the official Ubuntu Server ISO from the Ubuntu website (server downloads section). Whenever possible, choose the latest LTS version to ensure several years of support and security updates.
Once you have the ISO file, you can mount it on a physical server (via USB or the provider's remote console) or on your virtualization platform (for example, by associating it as a CD/DVD drive in VMware, KVM, etc.). From there, you boot the machine and follow the installer.
During the process, you will be asked to choose your language, time zone, initial username, password, network settings, and, very importantly, disk layout . You can leave it in guided mode so the wizard can create the necessary partitions, or do it manually if you have specific requirements (LVM, RAID, etc.).
When the installation is complete, the system will restart and you will have an Ubuntu Server ready to start configuring , usually accessible via SSH with the user account you created or, in some provider environments, with direct access as root.
Ubuntu Server Environment: Ecosystem, Community, and Documentation
One of Ubuntu Server's greatest strengths is that it's built on widely tested open-source software , with comprehensive official repositories and thousands of packages ready to install with a simple `apt install`. This gives you enormous leeway to customize the system according to its intended use.
It's surrounded by a very active community of developers and users who contribute patches, improvements, and documentation. You'll find administration manuals, step-by-step installation guides, video tutorials, and specialized forums to resolve specific questions and problems.
Thanks to this flexibility, you can dedicate your Ubuntu server to a multitude of tasks: web server, database server, file server , email server , container platform, hybrid cloud node, test lab, etc. The same base system adapts to very different contexts without any juggling.
In addition, hosting and cloud providers often offer pre-installed Ubuntu Server templates or images , so you can deploy a VPS with Ubuntu pre-configured and focus directly on your applications.
Security and updates on an Ubuntu server
As with any modern Linux distribution, security is a fundamental pillar of Ubuntu Server. Canonical releases frequent updates to fix vulnerabilities and bugs, and LTS versions receive extended support, making it easier to maintain critical systems without constant changes.
To strengthen basic security, it's highly recommended to update all packages immediately after starting the server , using commands like `apt update` followed by `apt upgrade -y`. This ensures that the entire system is up to date before putting it into production.
The Uncomplicated Firewall (UFW) is integrated and greatly simplifies rule management. You can list available profiles with `ufw app list` , allow SSH traffic with `ufw allow OpenSSH`, and then activate the firewall with `ufw enable`, checking its status with `ufw status`.
In addition to the firewall, it's a good idea to disable unused services , harden your SSH settings (for example, by blocking direct root access or password authentication), and use public key-based authentication whenever possible.
Backup and services included on professional servers
Many dedicated server providers include additional backup storage space (e.g., 500 GB) that is physically separate from the main machine. The idea is that you can store your most critical files there: database data, configurations, web content, email files, etc.
Regular backups allow you to quickly restore service in the event of hardware failures, human error, or attacks, and, if you use cloud storage, encrypt them with Cryptomator . With Ubuntu Server, you can automate these backups using tools like rsync, borg, duplicity, custom scripts, or vendor-specific integrations.
In addition to backup space, many server plans offer IPv4 and IPv6 addresses, DDoS protection, guaranteed bandwidth, and service level agreements (SLAs) that ensure high hardware availability. All of this makes Ubuntu Server a valuable component of a well-maintained infrastructure.
Since Ubuntu Server is a free, open-source project, what you'll actually pay for is the processing power of the physical or virtual server : CPU, RAM, disks, network bandwidth, etc. Installation is usually automatic from the provider's control panel, with no additional operating system license fees.
First steps after installing Ubuntu Server: users, SSH and sudo
When you create a fresh Ubuntu server (for example, Ubuntu 20.04 or 22.04), it's crucial to perform some initial basic configuration to improve security and ease of use. You'll typically connect via SSH using the server's public IP address and either the root account or an initial user account.
The root account has full system privileges , meaning that a lapse in attention can cause serious problems. Therefore, it's common practice to create a regular user account for everyday tasks and only use `sudo` when you need administrator privileges.
You can add a new user with a command like adduser username , set a secure password, and, if you want to give it administrative capabilities, include it in the sudo group with usermod -aG sudo username.
From there, you can execute administrative commands by preceding the command with `sudo` , allowing you to continue working with a normal user account but with the ability to elevate privileges as needed. The system will periodically prompt you for the user's password to confirm your identity.
SSH access configuration and public keys
The SSH service (OpenSSH Server) allows you to remotely manage Ubuntu Server over the network. It comes pre-installed on many servers; if not, you can add it with `apt install openssh-server` and enable it with `systemctl start ssh` and `systemctl enable ssh`.
If you initially log in using a password, you can access the server with a command like `ssh user@server_ip` . However, it's considered much more secure to configure SSH key-based authentication, where your local machine stores the private key and the server only stores the public key.
To configure this mechanism, you can use tools like ssh-copy-id , which copies your public key to the user's ~/.ssh/authorized_keys file on the server. If the key is already configured for the root account, you can also copy the ~/.ssh structure to your new user using rsync with the appropriate permissions and ownership.
In the `/etc/ssh/sshd_config` file, it's recommended to disable the root shortcut (`PermitRootLogin no`) and, if you already have key authentication working, disable password authentication (`PasswordAuthentication no`). After changing these settings, restart the service with `systemctl restart ssh`.
Firewall with UFW and traffic control
Ubuntu Server includes UFW as a simple firewall management layer . Its philosophy is that, by default, all incoming traffic is blocked except for what you explicitly allow. This reduces the risk of a misconfigured service being unintentionally exposed.
Before activating UFW, it's advisable to allow SSH traffic with `ufw allow OpenSSH` to avoid losing remote access. Afterward, you can enable the firewall with `ufw enable` and confirm that it's active and allowing the necessary connections using `ufw status`.
As you install new services (for example, HTTP for a web server, or specific database ports), you'll need to open the corresponding ports in UFW using additional rules. This is well-suited for servers where you only want to expose a few services to the internet.
Key software installation: SSH, Docker, NGINX, and Apache
The "arsenal" of a typical Ubuntu server usually includes an SSH server, a web server, database support , and increasingly, container tools. Installation is primarily done with apt, using the official Ubuntu repositories.
To ensure remote access, the essential package is openssh-server . Once installed and activated, you can manage the server without directly accessing the physical console or the provider's web console.
If you work with containers, the usual way is to install Docker with `apt install docker.io` (or by following the official Docker repository for more recent versions). Then you can start and enable the service with `systemctl start docker` and `systemctl enable docker`, and add your user to the `docker` group with `usermod -aG docker $USER` to manage containers without using root.
For serving static web pages or lightweight applications, many administrators choose NGINX for its performance and simplicity. It is installed with `apt install nginx` and enabled in the same way as other services with `systemctl start` and `systemctl enable`.
If you prefer the classic LAMP stack, you can set up Apache as your web server , along with MySQL or PostgreSQL and languages like PHP or Python. The typical workflow includes installing Apache, checking its status with `systemctl status apache2`, opening the HTTP port in the firewall with `ufw allow 'Apache'`, configuring the site files in `/etc/apache2/sites-available` and enabling them with `a2ensite`, and then restarting the service.
Setting up a VNC server and a lightweight graphical environment
Although Ubuntu Server is launched without a graphical interface, in some scenarios it may be useful to install a lightweight graphical environment and access it via VNC , for example, for users who are more comfortable with a desktop or to manage certain visual tools.
A common option is to use XFCE as a lightweight desktop environment, installing it with a command that adds both the environment and its additional components (xfce4 and xfce4-goodies). This provides a functional desktop without significantly increasing resource consumption.
Then you can install a VNC server like TightVNC , configure it with an access password using vncserver, and create a startup script in ~/.vnc/xstartup that loads your XFCE environment when the VNC session opens.
Once you have marked the script as executable and launched vncserver with the desired resolution (for example, :1 -geometry 1280×800 -depth 24), you will be able to connect from a VNC client on your local machine using the server's IP address and the corresponding port, thus managing the Ubuntu Server remote desktop.
Optimization, vulnerability scanning, and performance
Beyond simply getting the system "working," it's worthwhile to dedicate some time to optimizing and auditing the security of Ubuntu Server , especially in environments exposed to the internet or containing sensitive data. One of the most widely used tools for security analysis in Linux is Lynis.
After installing Lynis from the appropriate repositories, you can run it to analyze the system configuration and generate a report with possible vulnerabilities, weaknesses, or areas for improvement (permissions, active services, network configurations, etc.).
Regarding performance, there are several measures that help a lot: disabling unused services , adjusting certain kernel parameters (for example, through /etc/sysctl.conf), properly configuring swap usage, and reviewing network parameters such as queues, buffers, or connection limits based on expected load.
These types of adjustments, along with a good monitoring strategy (tools such as top, htop, iotop, journalctl or more advanced solutions), allow the Ubuntu server to remain stable, secure and with performance that meets the needs of your applications.
Useful commands and troubleshooting common problems
In day-to-day operations, it's very common to have to diagnose space issues, services that won't start, or network failures . Ubuntu Server has a good set of commands that help with these tasks without needing to install anything unusual.
To check available disk space, you'll often use `df -h` , while to find out which directories are taking up the most space in a given path, you can use `du -sh * | sort -h`. This helps you quickly locate triggered logs or huge folders that you should clean up or move.
If a service fails to start or behaves strangely, in addition to `systemctl status service_name`, it is often very useful to use `journalctl -u service_name` to view the associated log messages and understand what is failing.
For networking, the ping and traceroute commands (or tracepath in some installations) are used to check connectivity and routes to other hosts, such as google.com or internal servers. And if you suspect the firewall is blocking legitimate traffic, you can always review the current rules with ufw status.
After kernel updates or changes to the boot manager, you may need to regenerate the GRUB configuration using `update-grub` , especially if you have added or modified disks and partitions. This ensures that the system continues to boot correctly from the expected kernel version.
It's clear that Ubuntu Server is a very complete, robust, and flexible platform for setting up everything from small home services to complex enterprise infrastructures; its combination of stability, security, community, ease of use, and zero licensing costs makes it a very solid choice for anyone who wants to set up a modern Linux server without overcomplicating things.