How to Quickly Deploy a WordPress Site Using Container Instances in OCI

Share on:



Container Instance:

OCI Container Instances enables you to easily run applications on serverless compute optimized for containers.

Using Container Instances, you can easily launch one or more containers with the flexibility to specify compute shape, resource allocation, networking, and other optional configurations.


How to create Container Instance in OCI

Go to OCI –> Developer Services –> Container Instances –> Click on Create container instance

There are 3 steps in Container instance creation


1. Add basic details

Here we provide the container name, compartment, Availability domain, and Fault domain, Choose the shape.



Only 2 Shapes are available here CI.Standard.E4.Flex and CI.Standard.E3.Flex, choose the OCPUs and memory for whatever shape we choose. 

I select 4 OCPUs and 8 GB of Memory



For the Networking part, I already have VCN, subnet so I choose to select those, you can also create a new VCN here if you don’t have one.


Click Next.


2. Configure containers – Here we can add as many containers as we need to depending on the resources we choose in 1st step. 

I will configure 2 containers to set up this WordPress website (one will use WordPress image and another will use MySQL DB Image)

There are 2 ways to select Image when configuring containers in OCI, one using the OCI container registry and another using an external registry (like Docker Hub)

So I choose WordPress Images from the Docker Hub and MySQL Images from the OCIR Registry.

For How to set up OCIR Image, you can see my previous blog.

All About OCIR

Here I choose WordPress Docker Image for 1st container



Add these environment variables as per the Image description on the Docker Hub


WordPress Image

Enable resource throttling and assign 50% of resources to this container.



Click on +another container and add the MySQL Container


This time I choose the Image from my OCIR Registry



If the registry is Private you have to specify the credentials


Now set up some environment variables to initialize the MYSQL Database as per the Image Description.




Enable resource throttling and assign the rest of the 50% resource to this container.



We also need to pass the below argument to enable the database password authentication plugin



Click Next 


3. Review all the information before creating container Instances.



And Click Create, It will take a few seconds to launch the container instances



You can see 2 containers each utilizing 50% of resources as we set up



So we assigned the public IP to this Instance, using which we can access this WordPress website.


Before that make sure port 80 is open as the WordPress Site Uses port 80, so go to your security list and open port 80 on Ingress rules.



Now copy the public IP address from Container Instance and hit on the browser and you will see the WordPress site is live on the internet



I go ahead and select the language and on the next screen choose Site title, username, password, and your email address and Install WordPress



Next log in with your username/password



And Voila! Website is ready


Share on:

More from this Author


How to Import Custom Visualization in Oracle Analytics Cloud to See Images

In this blog, I will show you how to download and import the Image Gallery Plugin into OCI Oracle Analytics Cloud. using this plugin we can see ... Read More

Oracle 23c INTERVAL Data Type Aggregations

Analyze Invoices with Oracle Analytics and AI Document Understanding

OCI Document Understanding is an AI service that enables developers to extract text, tables, and other key data from document files through APIs and ... Read More

Back to Top