• use oracle cloud free instance to set up a wordpress website step by step instruction
    Le Papillon

    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.

    1. Sign in to the Oracle Cloud Infrastructure Console.
    2. Open the navigation menu and go to Identity & Security -> Identity -> Compartments.
    3. Click Create Compartment.
    4. 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.

    1. From the main console landing page, scroll down to “Launch Resources” and select the Create a VM instance workflow .
    2. Name your instance: Give it a descriptive name, like “WordPress-Server”.
    3. Choose your compartment: Select the compartment you created in Step 1 .
    4. 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).
    5. 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 .
    6. 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 .
    7. 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 .
    8. 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)

    1. Go to the navigation menu and select Networking -> Virtual Cloud Networks.
    2. Click on the VCN that was created with your instance (it will have a similar name).
    3. Click on the public subnet link.
    4. Under “Resources”, click on the Default Security List.
    5. 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.

    1. On the OCI console, go to Compute -> Instances and click on your instance. Copy its Public IP address.
    2. Open your terminal (or PowerShell) and navigate to the directory where you saved your private SSH key.
    3. 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.

    1. Update your system’s package list: sudo apt update
    2. 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
    3. 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.

    1. 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.
    2. 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.

    1. Download the latest WordPress package: cd /tmp curl -O https://wordpress.org/latest.tar.gz
    2. Extract the files to your web server’s root directory: sudo tar zxf latest.tar.gz -C /var/www/html/ --strip 1
    3. 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.

    1. Open a web browser and go to your instance’s public IP address: http://<your-public-ip-address>
    2. You will see the WordPress setup welcome page. Select your language and click Continue.
    3. WordPress will notify you that it needs your database details. Click Let’s go! .
    4. 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.
    5. If the connection is successful, click Run the installation.
    6. 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.
    7. Click Install WordPress.
    8. 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

    We are glad you have chosen to leave a comment. Please keep in mind that comments are moderated according to our comment policy .
    Posting comment on "use oracle cloud free instance to set up a wordpress website step by step instruction"
    1 2 3 4 5
    Thank you for your comment.

    There is no comment for this post currently,
    be the first one to write a comment.

    Le Papillon

    Author Rank: 10
    Author's Name: kk Zhang
    User ID: 10000325
    Number of posts published by user: 4


    Related     Posts
    No image
    04/24/2026  |  
    how to host google font locally for my wordpress online website

    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
    » » » »

    No image
    04/22/2026  |  
    how to set up wordpress website on local computer

    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
    » » » »

    No image
    04/21/2026  |  
    after setting up my wordpress website on local computer, how to make it accessible to the public user and public user is able to preview the wordpress website locally built on my personal computer? pros and cons?

    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
    » » » »

    03/21/2022  |  
    在甲骨文 Oracle Cloud 上搭建永久免费 WordPress 网站

    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

    No image
    01/21/2021  |  
    模板问题

    参考 外观–》 自定义–》主页设置–》主页名 主页名 -> Setting -> CONTENT LAYOUT -> 100% Full Width The Menus Screen enables the user to create a custom menu (also known as a
    » » » »

    No image
    12/10/2020  |  
    有关主机地区的问题

    在使用云服务器的时候 一开始会有主机地区选择 有些同学可能会选择主机地区在国内 觉得自己的网站对象是国内用户 或者有些同学不是使用云服务器 是选择使用我们大家经常用的主机托管公司 主机提供商很多了 像Blue Host, Hostgator, GoDaddy等等 界面友好 不像谷歌云和阿里云这样子我们需要自己打入LINUX的指令 在选择主机地区的时候 如果你是打算搭建WordPress网站 最好主机地区不要选择在国内大陆 虽然WordPress是开源的 在国内使用访问登录没有问题 但是因为你所选择的WordPress主题或者插件可能会用到Google的产品 像Google Font, Google Map等等 或者会用到其他被禁的产品 我不知道JQuery是不是也在国内禁用 JQuery是大多数WordPress主题都会用到的JavaScript代码库 如果你的主机放在国内 你所选择的WordPress主题需要的这些的文件和程序可能拿取不到
    » » » »

    No image
    12/08/2020  |  
    使用all in one wp migration不可以导出网站

    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
    » » » »

    No image
    12/07/2020  |  
    想用all in one wp migration迁移WordPPress网站 文件大于512M

    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
    » » » »

    No image
    12/07/2020  |  
    谷歌云搭建的WordPress登录密码忘记了 收不到邮件恢复密码

    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
    » » » »

    No image
    12/07/2020  |  
    Elementor在使用过程中有问题

    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.
    » » » »

    No image
    12/07/2020  |  
    Screen Options不可以下拉

    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
    » » » »

    No image
    12/07/2020  |  
    阿里云分国际和国内版?

    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.
    » » » »

    No image
    12/07/2020  |  
    SSL 安全证书

    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
    » » » »

    12/06/2020  |  
    谷歌云 – 用完300元试用赠金或者没有用完?

    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,
    » » » »

    Categories: WordPress