Ubuntu VPS Hosting: Configuration, Performance, and What to Look For

Ubuntu VPS Hosting Configuration, Performance, and What to Look For

Ubuntu is the most widely deployed Linux distribution for VPS hosting. Ubuntu 22.04 LTS (Long Term Support) is the standard for production deployments, with support until April 2027. Ubuntu 24.04 LTS extends through 2029. This guide covers what to know before provisioning, how to configure Ubuntu VPS for production workloads, and which InMotion plans support…

Ubuntu Version Selection

The most important decision before provisioning is which Ubuntu version to use.

Ubuntu 22.04 LTS (Jammy Jellyfish): The current production standard. Ships with PHP 8.1 (upgradeable to 8.3), MySQL 8.0, Python 3.10, and Node.js 12.x (newer versions via NodeSource). Standard support through April 2027.

Ubuntu 24.04 LTS (Noble Numbat): The newer LTS release. Ships with PHP 8.3, MySQL 8.0, and Python 3.12. Standard support through April 2029. Good choice for new deployments where you don’t need to match an existing production environment.

Ubuntu 20.04 LTS reached end of standard support in April 2025. Do not use it for new deployments, and plan migrations for any existing servers running 20.04.

InMotion’s Cloud VPS supports Ubuntu 22.04 LTS as a provisioning option. Managed VPS plans also support Ubuntu across plan tiers.

Available plans: Cloud VPS (unmanaged, full root access) | Managed VPS (with cPanel and WHM)

Initial Server Configuration

Update the system

Always run a full system update immediately after provisioning.

sudo apt update && sudo apt upgrade -y

On Ubuntu 22.04, the unattended-upgrades package is typically pre-installed and configured for security updates. Verify it is active:

sudo systemctl status unattended-upgrades

Create a non-root user

Running as root is a security risk. Create a standard user with sudo privileges:

adduser yourusernameusermod -aG sudo yourusername

Configure the firewall with UFW

Ubuntu ships with UFW (Uncomplicated Firewall). Enable it with a minimal ruleset:

sudo ufw allow OpenSSHsudo ufw enablesudo ufw status

Add rules for your specific services as you install them. For a web server:

sudo ufw allow 'Nginx Full'   # or 'Apache Full'

Performance Configuration

Swap space

On a VPS with 1 to 4GB of RAM, a swap file acts as overflow memory when physical RAM is exhausted. Without it, processes are killed when memory fills. Create a 2GB swap file:

sudo fallocate -l 2G /swapfilesudo chmod 600 /swapfilesudo mkswap /swapfilesudo swapon /swapfile

Make it permanent by adding to /etc/fstab:

/swapfile none swap sw 0 0

Tune swappiness (how aggressively the kernel uses swap) to 10 for a server environment, meaning the kernel will use swap sparingly and prefer keeping data in RAM:

echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.confsudo sysctl -p

TCP and network optimizations

For web servers handling significant traffic, adjust TCP settings in /etc/sysctl.conf:

net.core.somaxconn = 65535net.ipv4.tcp_max_syn_backlog = 65535net.ipv4.tcp_tw_reuse = 1

Apply without reboot:

sudo sysctl -p

File descriptor limits

High-traffic web servers and database engines can exhaust the default file descriptor limit. Increase it in /etc/security/limits.conf:

* soft nofile 65536* hard nofile 65536

PHP Configuration for Web Applications

Ubuntu 22.04 ships with PHP 8.1 from the default apt repository. Install a specific version and PHP-FPM for web server integration:

sudo apt install php8.2-fpm php8.2-mysql php8.2-curl php8.2-gd php8.2-mbstring php8.2-xml php8.2-zip

Key php.ini settings to review for production:

memory_limit = 256Mupload_max_filesize = 64Mpost_max_size = 64Mmax_execution_time = 60opcache.enable = 1opcache.memory_consumption = 128opcache.max_accelerated_files = 10000

PHP-FPM pool configuration (typically in /etc/php/8.2/fpm/pool.d/www.conf) should be tuned to your server’s RAM. For a 4GB VPS:

pm = dynamicpm.max_children = 20pm.start_servers = 5pm.min_spare_servers = 5pm.max_spare_servers = 10

MySQL Configuration

MySQL’s default configuration is conservative and not optimized for most web applications. After installing MySQL Server, edit /etc/mysql/mysql.conf.d/mysqld.cnf. Key settings for a 4GB VPS:

innodb_buffer_pool_size = 1Ginnodb_log_file_size = 256Mmax_connections = 200query_cache_type = 0innodb_flush_log_at_trx_commit = 2

innodb_buffer_pool_size should be set to approximately 70% of available RAM on a server dedicated to MySQL. On a shared application server, 25 to 30% is more appropriate.

Managed vs. Unmanaged Ubuntu VPS: Which Fits Your Needs

InMotion offers two distinct Ubuntu VPS environments. The choice between them comes down to how much server administration you want to handle yourself.

InMotion’s Cloud VPS is unmanaged. You get a provisioned Ubuntu server with root access, and all configuration, security patching, and software installation is your responsibility. This is the right model for developers, sysadmins, and technical teams who want full control and have the expertise to operate a server production environment.

InMotion’s Managed VPS includes cPanel and WHM pre-installed, server-level security patch management, and 24/7 human support for infrastructure issues. The trade-off is some configuration flexibility in exchange for operational overhead reduction. For businesses without dedicated sysadmin capacity, this is the more sustainable long-term choice.

Premier Care, available as an add-on for managed VPS, adds Monarx malware defense, 300GB automated backup storage, and priority APS support. For agencies managing client sites on VPS infrastructure, Premier Care provides the security and backup layer that care plan clients expect.

Related: How to Setup a VPS Server

InMotion’s Cloud VPS includes Ubuntu 22.04 LTS with root SSH access, high-availability architecture replicating across three nodes, and flexible plan upgrades. Explore plans at inmotionhosting.com/cloud-vps.

Share this Article

Leave a Reply

Your email address will not be published. Required fields are marked *