use oracle cloud free instance to set up a wordpress website step by step instruction
Setting up a WordPress website on Oracle Cloud’s free tier is a great way to build a site with no upfront costs. The process involves setting up your cloud environment, creating a virtual machine, and then installing the web server, database, and WordPress itself.
Here is a step-by-step guide to walk you through the entire process using an Ubuntu Linux instance.
Prerequisites
Before you begin, ensure you have:
An Oracle Cloud Infrastructure Free Tier account. If you don’t have one, you can sign up on their website.
A computer (MacOS, Linux, or Windows) with an SSH client (like Terminal on Mac/Linux or PowerShell on Windows) to connect to your cloud server .
Step 1: Set Up a Compartment (Optional but Recommended)
A compartment is a logical container for your cloud resources, helping you organize and manage them.
Sign in to the Oracle Cloud Infrastructure Console.
Open the navigation menu and go to Identity & Security -> Identity -> Compartments.
Click Create Compartment.
Enter a name (e.g., “WordPress-Compartment”) and a description, then click Create Compartment .
Step 2: Create Your Free Virtual Machine (VM) Instance
This is where your WordPress site will live.
From the main console landing page, scroll down to “Launch Resources” and select the Create a VM instance workflow .
Name your instance: Give it a descriptive name, like “WordPress-Server”.
Choose your compartment: Select the compartment you created in Step 1 .
Edit the Image: Click the Edit button next to “Image and shape”.
Click Change image.
Select the Ubuntu image. Choose a version like Canonical Ubuntu 24.04 or 22.04 (this guide is compatible with both).
Confirm the Shape: Ensure the shape selected is the Always Free-eligible one, such as VM.Standard.E2.1.Micro (AMD) or an Arm-based one. This confirms you won’t be charged .
Configure Networking: In the “Networking” section, ensure Assign a public IPv4 address is selected. Let the system create a new Virtual Cloud Network (VCN) for you .
Add SSH Keys: This is crucial for secure access.
Select Generate a key pair for me.
Immediately click Save Private Key and Save Public Key to download both files to a safe folder on your computer. You will not be able to retrieve them later .
Click Create. It will take a few minutes for your instance to provision.
Step 3: Configure Firewall to Allow Web Traffic
To make your website accessible from the internet, you need to open port 80 (for HTTP) and optionally port 443 (for HTTPS) in both the cloud firewall and the instance’s internal firewall.
Part A: Configure the Cloud Firewall (Ingress Rules)
Go to the navigation menu and select Networking -> Virtual Cloud Networks.
Click on the VCN that was created with your instance (it will have a similar name).
Click on the public subnet link.
Under “Resources”, click on the Default Security List.
Click Add Ingress Rules and add the following rule :
Source Type: CIDR
Source CIDR: 0.0.0.0/0 (This allows traffic from anywhere on the internet)
IP Protocol: TCP
Destination Port Range: 80,443 (This opens both HTTP and HTTPS ports)
Description: “Allow web traffic”
Click Add Ingress Rules.
Step 4: Connect to Your Instance via SSH
Now, you’ll connect to your virtual server from your local computer.
On the OCI console, go to Compute -> Instances and click on your instance. Copy its Public IP address.
Open your terminal (or PowerShell) and navigate to the directory where you saved your private SSH key.
Run the following command to connect. Remember to replace <private-key-file> with your key’s filename and <public-ip> with the IP address you copied. bash ssh -i <private-key-file> ubuntu@<public-ip> Since you’re connecting for the first time, you might be asked to confirm the connection. Type yes and press Enter .
Step 5: Install the LAMP Stack (Linux, Apache, MySQL, PHP)
Once connected to your server via SSH, you’ll install all the necessary software.
Update your system’s package list: sudo apt update
Install Apache, MySQL, and PHP: This command installs the web server (Apache), the database (MySQL), the core programming language (PHP), and all the extra PHP modules WordPress needs to run. sudo apt install -y apache2 mysql-server php libapache2-mod-php php-mysql php-curl php-gd php-xml php-mbstring php-zip php-json
Open the instance’s internal firewall for web traffic: Even though you opened the cloud firewall, Ubuntu also has its own internal firewall (iptables). These commands make the rules persistent after a reboot . bash sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 443 -j ACCEPT sudo netfilter-persistent save
Step 6: Secure Your MySQL Database
It’s essential to set a password and remove insecure defaults from your new database installation.
Run the MySQL secure installation script: sudo mysql_secure_installation You will be guided through a series of prompts:
Set up the VALIDATE PASSWORD COMPONENT? (Optional, but recommended for security).
Enter a new strong password for the MySQL root user.
Type Y to remove anonymous users.
Type Y to disallow root login remotely.
Type Y to remove the test database.
Type Y to reload privileges tables.
Create a database and user for WordPress: Log in to the MySQL console with your new root password. bash sudo mysql -u root -p Once logged in, run the following SQL commands (replace 'your-database-password' with a strong, unique password) : sql CREATE DATABASE wordpress; CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'your-database-password'; GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost'; FLUSH PRIVILEGES; EXIT;
Step 7: Download and Configure WordPress
Now, you’ll download WordPress and set the correct file permissions.
Download the latest WordPress package: cd /tmp curl -O https://wordpress.org/latest.tar.gz
Extract the files to your web server’s root directory: sudo tar zxf latest.tar.gz -C /var/www/html/ --strip 1
Set correct file ownership and permissions: The web server (Apache) needs to own the files to be able to read and write them. bash sudo chown -R www-data:www-data /var/www/html/ sudo chmod -R 755 /var/www/html/ Create an uploads directory and set its ownership as well . bash sudo mkdir -p /var/www/html/wp-content/uploads sudo chown -R www-data:www-data /var/www/html/wp-content/uploads
Step 8: Complete the Installation Through Your Web Browser
The final steps are done through a simple web-based wizard.
Open a web browser and go to your instance’s public IP address: http://<your-public-ip-address>
You will see the WordPress setup welcome page. Select your language and click Continue.
WordPress will notify you that it needs your database details. Click Let’s go! .
Enter the database information you created in Step 6 :
Database Name: wordpress
Username: wpuser
Password: <your-database-password>
Database Host: localhost (since the database is on the same server)
Table Prefix: Leave as wp_ (or change if you wish).
Click Submit.
If the connection is successful, click Run the installation.
Fill in the information for your new site:
Site Title: The name of your website.
Username: The admin username for your WordPress site (choose something secure, not “admin”).
Password: A strong password for your admin account.
Your Email: Your email address.
Search Engine Visibility: Choose if you want search engines to index your site.
Click Install WordPress.
After a successful installation, click Log In and use the admin username and password you just created.
Congratulations! You now have a fully functional WordPress website running on Oracle Cloud’s free tier.
Next Steps & Considerations
Register a Domain Name: Instead of using the IP address, you can buy a domain name (like yourwebsite.com) and point it to your server’s IP.
Enable HTTPS: It’s highly recommended to secure your site with an SSL certificate. You can use Let’s Encrypt, which is a free, automated service for this purpose .
Keep Your Site Updated: Regularly run sudo apt update && sudo apt upgrade on your server and keep your WordPress themes and plugins updated to ensure security.
Account Idle Policy: Be aware that Oracle may reclaim idle Always Free compute instances. To avoid this, ensure your instance is not idle by having a reasonable amount of CPU and network activity .
Comment
Comment Message Box Error
Enter key is not allowed in message box. Please do not use newline break key!
There is no comment for this post currently, be the first one to write a comment.
Hosting Google Fonts locally on your WordPress site is an excellent way to boost your site’s performance, improve privacy compliance (like GDPR), and give you more control over » » » »
Of course! Setting up a WordPress website on your local computer is an excellent way to learn, test themes/plugins, or build a site before it goes live. This » » » »
Making your locally-built WordPress site accessible to the public is a common next step for sharing your work or getting client feedback. There are two main paths you » » » »
Key tasks include how to: Free Tier: Install WordPress on an Ubuntu Instance https://docs.oracle.com/en-us/iaas/developer-tutorials/tutorials/wp-on-ubuntu/01-summary.htm
参考 外观–》 自定义–》主页设置–》主页名 主页名 -> Setting -> CONTENT LAYOUT -> 100% Full Width The Menus Screen enables the user to create a custom menu (also known as a » » » »
Introduced in 2013 and used by over 60 million websites, All-in-One WP Migration is verifiably one of WordPress’ most trusted and utilized plugins for moving websites with absolute » » » »
When building websites, we tend to create a site locally or on a development server and then migrate the site on the client’s server when done. The All » » » »
Why Add an Admin User to the WordPress Database via MySQL?We once ran into an issue where a user’s site was hacked, and their admin account was deleted » » » »
Create a WebsiteDesign Your FuturePower your vision with Elementor to build, manage and host stunning websites!We’ve got you covered from A-to-Z with the #1 website platform for WordPress. » » » »
Screen Options is a fly down menu button located on the top right corner of some pages in your WordPress admin area. When clicked, Screen Options menu shows » » » »
Alibaba Cloud is more of an International Entity subsidiary of Alibaba Group which is still in the progress of porting of all the services from Aliyun with enhancements. » » » »
DescriptionReally Simple SSL will automatically configure your website to use SSL to its fullest potential. Use extra security features to protect your website, and use our server health » » » »
Google Cloud Platform (GCP), offered by Google, is a suite of cloud computing services that provides a series of modular cloud services including computing, data storage, data analytics, » » » »
Generic singular.php will be used for single post which does not have specified format for that category or post type.
2
If you are logged in, the post comment will only ask for post rating, comment title and message. If you are not logged in and is a visitor, the post comment will ask for more questions of your name, email, phone, country.
Country should be selected from the drop-down list.
Comment message should contain at least 10 characters.
The post rating answer will be converted into one to five stars rating system based on your answer from number 1 to 5.
If user is logged in already, the country name field will get its value from the user profile in WordPress, which is different from user profile registered in WooCommerce.
5
Total number of the comment will include the counting of sub-comment (second-level comment replying to top-level comment).
6
Each page will break every 3 top-level comments into pages, click Older Comments or Newer Comments to view more comments.
7
Click the close icon on the right-top corner of this section to close this instruction.
Comment
Comment Message Box Error
Please do not use newline break key!
be the first one to write a comment.