Support Online
Skip to main content

Installing WordPress with Docker: Multi-Site Management on Ubuntu

What Will You Learn in This Guide?

In this guide, you will learn Running multiple WordPress sites on Ubuntu with Docker container technology.
The goal is to establish an isolated, secure and scalable WordPress infrastructure on a single server.

🧠 Technical Summary

Main Technical Topic:
Multiple WordPress container deployment using Docker on Ubuntu.

Solved Problem:
The need to manage multiple WordPress sites on the same server without conflict.

Steps Followed:

  • Installing the Docker engine
  • Firewall (UFW) configuration
  • Use of ready WordPress image
  • Access and port settings of containers
  • Resource control with RAM limitation

1️⃣ Installing Docker on Ubuntu

1. First, update your server and install the Docker engine.

sudo apt-get update
sudo apt-get install lxc-docker git
  • These commands update the system packages and install the Docker engine on the system.

2️⃣ UFW Traffic Permissions for Docker

1. UFW is configured so that Docker can properly manage network traffic.


sudo nano /etc/default/ufw
  • This file is opened to edit the UFW routing policy.


DEFAULT_FORWARD_POLICY="ACCEPT"
  • This setting allows Docker container traffic.


sudo ufw reload
  • This command reloads the firewall settings.

3️⃣ Downloading the WordPress Docker Image

  1. Import the ready and optimized WordPress image into the system.

docker pull tutum/wordpress
  • This command downloads the ready image containing WordPress and its dependencies.

4️⃣ Publishing the WordPress Container

1. You can run WordPress open to the outside world.


docker run -d --name tr1-blog -p 80:80 tutum/wordpress
  • This command starts WordPress in the background and accesses it on port 80.

5️⃣ Local Access Only WordPress Container

1. You can make WordPress accessible only via localhost.


docker run -d -p 127.0.0.1:8080:80 tutum/wordpress
  • This command makes WordPress accessible only from the local network.

6️⃣ Container Resource (RAM) Limitation

1. You can set RAM limit for each WordPress site.


docker run -d -m 256m -p 8081:80 tutum/wordpress
  • This command allows the container to use a maximum of 256 MB of RAM.

7️⃣ Checking Running Containers

1. View active containers and their status.


docker ps
  • This command lists all running Docker containers.

❓ Frequently Asked Questions (FAQ)

1. Why is Docker more advantageous than the classic WordPress installation? Each site works in isolation and one does not affect the other.

2. How many WordPress can I run on the same server? It depends on the RAM and CPU capacity of the server.

3. Will data be lost if the container is deleted? Yes, VOLUME must be used for persistence.

4. Does performance decrease? With the correct RAM limits, performance generally increases.


🎯 Result

Managing WordPress with Docker is a modern and scalable solution. You can safely run dozens of sites on a single server. You can try this architecture immediately on the GenixNode* infrastructure 🚀