Configuring Ubuntu for Containerized Blog Engine

There are some prerequisites on the OS to support Dockerized WordPress.

  • Update OS (packges) with sudo apt-get update && sudo apt-get upgrade
  • Install Docker Engine by executing the following commands.
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
sudo usermod -aG docker $USER
  • Install docker-compose by executing the following commands.
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
  • Install VIM by executing sudo apt-get install vim (This is necessary to edit config files while working on configurations.
  • Install net-tools by executing sudo apt-get install net-tools. This is not a must but it helps to check if your host is listening to the expected ports. sudo netstat -tulp is useful to check the listening ports.
  • Install ufw to manage firewall on Ubuntu. sudo apt-get install ufw
  • Open ports 80, 443 and 8080 by executing the following command. Adding 22 for ssh access.
    sudo ufw allow 80 && sudo ufw allow 443 && sudo ufw allow 8080 && sudo ufw allow 22 && sudo ufw enable

That’s pretty much what you need to get ready your own Dockerized self hosted WordPress on your own Cloud.


Author: admin

A software engineer in greater Seattle area

Leave a Reply

Your email address will not be published. Required fields are marked *