To install WordPress on a cloud server you need a Linux server (Ubuntu or CentOS), the LAMP or LEMP stack, a MySQL/MariaDB database, and the WordPress package itself. The entire process takes less than an hour if you follow the steps in order.
Unlike shared hosting, a cloud server gives you full control: you choose the operating system, configure the web server, and tune performance to your needs. This tutorial walks through every step from scratch.
1. Prerequisites: What You Need Before You Start
Before running any commands, make sure you have:
- An active cloud server — Ubuntu 22.04 LTS is the most stable and well-documented option in 2025.
- SSH access to the server (key or password). If you don't have a server yet, elenlace.com offers managed cloud hosting plans based in Mexico.
- A domain pointed to your server's IP (A records configured).
- Basic terminal knowledge — copy/pasting commands is enough.
2. Install the LAMP Stack (Apache, MySQL, PHP)
WordPress needs a web server, a database, and PHP. The most common stack on Linux is LAMP.
Update system packages
sudo apt update && sudo apt upgrade -y
Install Apache
sudo apt install apache2 -y
sudo systemctl enable apache2
sudo systemctl start apache2
Install MySQL (MariaDB)
sudo apt install mariadb-server -y
sudo mysql_secure_installation
During mysql_secure_installation, accept the security options: remove anonymous users, disable remote root access, and drop the test database.
Install PHP and required extensions
sudo apt install php php-mysql php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip -y
WordPress 6.x requires at least PHP 7.4; PHP 8.1 or later is recommended for better performance.
3. Create the WordPress Database
WordPress stores all its content in a relational database. Create it before running the installer.
sudo mysql -u root -p
Inside the MySQL prompt, run:
CREATE DATABASE wordpress_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'strong_password';
GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Use a long, random password. Save it — you'll need it in the next step.
4. Download and Install WordPress
Download the latest version
cd /tmp
wget https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
sudo mv wordpress /var/www/html/my-site
Set correct permissions
sudo chown -R www-data:www-data /var/www/html/my-site
sudo chmod -R 755 /var/www/html/my-site
Create wp-config.php
cd /var/www/html/my-site
sudo cp wp-config-sample.php wp-config.php
sudo nano wp-config.php
Edit these three lines with your database credentials:
define( 'DB_NAME', 'wordpress_db' );
define( 'DB_USER', 'wp_user' );
define( 'DB_PASSWORD', 'strong_password' );
Also replace the security salts using the official generator: https://api.wordpress.org/secret-key/1.1/salt/
5. Configure Apache for Your Site
Create a dedicated Virtual Host for your domain:
sudo nano /etc/apache2/sites-available/my-site.conf
File contents:
<VirtualHost *:80>
ServerName mysite.com
ServerAlias www.mysite.com
DocumentRoot /var/www/html/my-site
<Directory /var/www/html/my-site>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/mysite-error.log
CustomLog ${APACHE_LOG_DIR}/mysite-access.log combined
</VirtualHost>
Enable the site and rewrite module:
sudo a2ensite my-site.conf
sudo a2enmod rewrite
sudo systemctl reload apache2
Install SSL with Let's Encrypt
sudo apt install certbot python3-certbot-apache -y
sudo certbot --apache -d mysite.com -d www.mysite.com
Certbot configures HTTPS automatically and renews the certificate every 90 days.
6. Complete the Installation in Your Browser
Visit https://mysite.com in your browser. The WordPress wizard will ask for:
- Site title
- Admin username and password
- Admin email address
Click Install WordPress. Your site will be live within seconds.
| Step | Estimated Time | Difficulty |
|---|---|---|
| Install LAMP | 5–10 min | Low |
| Create database | 2–3 min | Low |
| Download and move WordPress | 3–5 min | Low |
| Configure Apache + SSL | 10–15 min | Medium |
| Browser wizard | 2 min | Very low |
Key Takeaways
- An Ubuntu 22.04 cloud server with the LAMP stack is the most stable and documented environment for WordPress.
- Create the database before running the WordPress installer.
- Correct permissions (
www-data,755/644) prevent the most common installation errors. - HTTPS with Let's Encrypt is free and configured in under two minutes with Certbot.
- The browser wizard completes the installation without touching the terminal again.
Prefer to skip the technical side? The team at elenlace.com can set up your cloud server with WordPress ready for production — including SSL, PHP optimization, and automated backups. Find more guides in our cloud hosting blog.
FAQ
Can I install WordPress on any cloud provider?
Yes. The process is virtually identical on any VPS or cloud server running Ubuntu or CentOS, whether it's DigitalOcean, Linode, AWS EC2, or a local provider. What changes is the control panel for creating the server, not the installation commands.
Which PHP version does WordPress require?
WordPress 6.x requires at minimum PHP 7.4, but the official team recommends PHP 8.1 or 8.2 for optimal performance. Always install the latest version compatible with your plugins.
Is HTTPS required for WordPress?
It's not technically mandatory for WordPress to function, but it's essential for SEO, admin login security, and user trust. Let's Encrypt provides it for free, and Certbot configures it with a single command.
Can I run multiple WordPress sites on the same cloud server?
Yes. Just create an additional Virtual Host in Apache, a separate database, and a different folder under /var/www/html/ for each site. Server resources are shared, so make sure you have enough RAM and CPU.
Further reading
Other providers and guides worth comparing: