โ Step 1: Connect to Your Server via SSH
To begin, you’ll need to SSH into your Ubuntu 20.04 server. From your local terminal:
Replace username with your actual username (often root on fresh VPS setups) and your_server_ip with your server's IP address. You can find this information in portal.cloudnium.net under your VPS services section.
Example:
If it’s your first time connecting, you’ll be prompted to confirm the authenticity of the server. Type yes and hit Enter.
๐ฅ Step 2: Update Your System
Before we install anything, make sure your system is up-to-date:
This ensures you're installing the latest versions and security patches.
๐ Step 3: Install Apache
Apache is the web server that will serve your site to users.
Once installed, enable it to start at boot and then start it:
Test it! Go to your browser and visit:
You should see the Apache default page — success!
๐พ Step 4: Install MySQL
Next up: the database. Install MySQL with:
Secure the installation:
During the setup:
-
You can set a root password.
-
Remove anonymous users.
-
Disallow root remote login.
-
Remove test databases.
-
Reload privileges.
For extra security, consider logging into MySQL to create a dedicated database and user later.
๐ง Step 5: Install PHP
Now for the dynamic part — PHP! Install PHP along with the Apache module and MySQL support:
You can test PHP is working by creating a test file:
Add the following line:
Save and exit (CTRL + O Enter Finally CTRL + X).
Now visit:
You should see the PHP info page! ๐
โ๏ธ Optional: Install Additional PHP Modules
Depending on your app, you might need more PHP modules:
๐งน Step 6: Cleanup and Secure
Once everything is working:
-
Remove the test PHP file for security:
-
Restart Apache:
๐ฆ Bonus: Create a MySQL Database and User
To create a new database and user:
Inside the MySQL shell:
๐ You Did It!
You now have a fully functional LAMP stack running on Ubuntu 20.04! Your server is ready to host WordPress, Laravel, or any PHP-based site or application.