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.
On Ubuntu 22.04, the unattended-upgrades package is typically pre-installed and configured for security updates. Verify it is active:
Create a non-root user
Running as root is a security risk. Create a standard user with sudo privileges:
Configure the firewall with UFW
Ubuntu ships with UFW (Uncomplicated Firewall). Enable it with a minimal ruleset:
Add rules for your specific services as you install them. For a web server:
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:
Make it permanent by adding to /etc/fstab:
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:
TCP and network optimizations
For web servers handling significant traffic, adjust TCP settings in /etc/sysctl.conf:
Apply without reboot:
File descriptor limits
High-traffic web servers and database engines can exhaust the default file descriptor limit. Increase it in /etc/security/limits.conf:
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:
Key php.ini settings to review for production:
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:
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 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
