Prerequisites
- An active Oracle Cloud account.
- A domain name (registered at Porkbun or similar).
Yes, this guide was partly generated by AI (for formatting), specifically Gemini, but was fact-checked by me.
Phase 1: Create the VPS Instance (Oracle Cloud)
- Login: Go to the Oracle Cloud Console.
- Navigate: Go to Compute > Instances > Create Instance.
- Name:
my-wordpress-server(or similar). - Image & Shape:
- Image: Change Image > Canonical Ubuntu 24.04 Minimal.
- Shape: Change Shape > VM.Standard.E2.1.Micro (AMD, 1 OCPU, 1GB RAM).
- Networking:
- Keep options as is, we’ll get an IP address later which won’t change
- SSH Keys:
- Select “Generate a key pair for me” (or upload your own public key).
- IMPORTANT: Click Save Private Key. Keep this safe; you cannot log in without it.
- Create: Click the Create button. Wait for the state to turn “Running” (Green).
Phase 2: Configure Networking (Open Ports 80/443) and IP
You must open the firewall in two places: the Oracle Network (VCN) and the Server itself.
A. Oracle Cloud Console (VCN)
- On the Instance details page, click the link under Subnet (e.g.,
subnet-2026...). - Click Default Security List for…
- Click Add Ingress Rules.
- Add the following rule:
- Source CIDR:
0.0.0.0/0 - IP Protocol: TCP
- Destination Port Range:
80,443
- Source CIDR:
- Click Add Ingress Rules.
B. Server Internal Firewall (IPTables)
Connect to your server via SSH and run these commands to insert allow rules at the top of the list:
sudo apt update
sudo apt install iptables-persistent -y
sudo iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
sudo iptables -I INPUT 1 -p tcp --dport 443 -j ACCEPT
sudo netfilter-persistent save
C. IP Address Assignment
- Search for “Reserved Public IP” in the search bar, click it.
- Click Reserve Public IP
- Give it a name, eg, WordPress
- Reserve it with the button on the bottom left.
- Go to Compute > Instances.
- Click on your instance name (
my-wordpress-server). - Scroll down to the Resources menu on the left side of the page.
- Click Attached VNICs.
- You will see a table with one item (usually named the same as your instance). Click the name of that VNIC (e.g.,
my-wordpress-server). - Find the IPv4 Configuration:
- On the new page that loads, look at the Resources menu on the left again.
- Click IPv4 Addresses.
- Swap the IP:
- You will see a row representing your server’s internal and external IP.
- Click the three dots (⋮) on the right side of that row.
- Select Edit.
- In the popup window, look for “Public IP Type”. Change it from “Ephemeral Public IP” to Reserved Public IP.
- A dropdown menu will appear. Select the IP you just named (e.g.,
WordPress). - Click Update.
Phase 3: System Prep
Since the server only has 1GB RAM, we must add a Swap file to prevent crashes.
1. Install Essentials
sudo apt update && sudo apt upgrade -y
sudo apt install nano wget curl net-tools -y
2. Create 2GB Swap File
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Phase 4: Install LAMP Stack (Linux, Apache, MySQL, PHP)
1. Install Apache
sudo apt install apache2 -y
sudo systemctl enable apache2
2. Install PHP & Extensions
sudo apt install php libapache2-mod-php php-mysql php-curl php-gd php-xml php-mbstring php-xmlrpc php-zip php-soap php-intl -y
sudo systemctl restart apache2
3. Install MySQL
sudo apt install mysql-server -y
4. Secure MySQL
sudo mysql_secure_installation
Settings: Validate Password (No), Remove anonymous (Yes), Disallow root remote (Yes), Remove test DB (Yes), Reload tables (Yes).
Phase 5: Create Database
Run commands one by one. Log into MySQL with sudo mysql -u root -p and run the following (replace ‘StrongPassword123’ with your own):
CREATE DATABASE wordpress;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'StrongPassword123';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Phase 6: Install WordPress (Root Directory)
cd /var/www/html
sudo wget https://wordpress.org/latest.tar.gz
sudo tar -xzvf latest.tar.gz
# Move files to main folder
sudo mv wordpress/* .
sudo rm -rf wordpress latest.tar.gz index.html
# Set Permissions
sudo chown -R www-data:www-data /var/www/html
sudo chmod -R 755 /var/www/html
Phase 7: Optimize Apache (Prevent Crashes)
Edit the configuration file: sudo nano /etc/apache2/mods-enabled/mpm_prefork.conf
Delete the existing content and replace it with this:
<IfModule mpm_prefork_module>
StartServers 2
MinSpareServers 2
MaxSpareServers 5
MaxRequestWorkers 10
MaxConnectionsPerChild 1000
</IfModule>
Restart Apache: sudo systemctl restart apache2
Phase 8: DNS Setup (Porkbun)
- Log in to Porkbun > Domain Management > DNS.
- Delete default parking records.
- Add Root Record:
- Type: A
- Host: (Leave Blank)
- Answer:
YOUR_ORACLE_IP
- Add WWW Record:
- Type: CNAME
- Host:
www - Answer:
yourdomain.com
Phase 9: SSL Certificate (HTTPS)
1. Install Certbot:
sudo apt install certbot python3-certbot-apache -y
2. Pre-configure Apache names: sudo nano /etc/apache2/sites-available/000-default.conf
DocumentRoot /var/www/html
ServerName yourdomain.com
ServerAlias www.yourdomain.com
3. Generate Certificate (Select “Redirect” when asked):
sudo systemctl reload apache2
sudo certbot --apache
Phase 10: Auto-Updates & Maintenance
# Set Timezone
sudo timedatectl set-timezone America/New_York
# Install Unattended Upgrades
sudo apt install unattended-upgrades -y
sudo dpkg-reconfigure --priority=low unattended-upgrades
Edit the schedule: sudo nano /etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-Time "02:00";
Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";
Phase 11: Final WordPress Setup
- Browser: Go to
https://yourdomain.com. - Language: English.
- Database Info:
- Name:
wordpress - User:
wp_user - Password:
StrongPassword123 - Host:
localhost
- Name:
