← Back to Guides
Profile image for Maria Alonso

By Maria Alonso

Published 28th January 2022

Deploy WordPress on Northflank

WordPress is an open source software to build websites and blogs and a content management system (CMS). It is one of the most popular web publishing tool in the world and is based on PHP and MySQL. 30% of the world’s websites are powered by WordPress and people choose them for over 11000 template themes, no-code platform, plugins and widgets.

Following this guide you will learn how to host your WordPress website or blog on Northflank. Configuration data will be stored in a MySQL database and content and media uploads will use persistent volumes.

  1. Create a new MySQL database. Under networking options, keep TLS and External Access disabled. You can start with the nf-compute-20 plan with 4GB of storage and one replica.

  2. Create a new secret group which will store the environment variables and build arguments. We will add both manual and inherited secrets. Inherited secrets come from the MySQL database we created earlier.

    1. Manual Secrets

      KeyValue
      WORDPRESS_DB_HOST${HOST}:${PORT}
      • Secret templating enables developers to generate environment variables from defined variables and inherited secrets from managed databases. Read more about them in our changelog.

    2. Inherited Environment Variables

      Variable nameAlias
      hostHOST
      portPORT
      usernameWORDPRESS_DB_USER
      passwordWORDPRESS_DB_PASSWORD
      databaseWORDPRESS_DB_NAME
      • Inheriting environment variables ensures that the database connection details are automatically injected in the environment, avoiding the need to manually copy and paste them.

  3. Create a deployment service. Choose external image as deployment source and the image path will be library/wordpress:latest from Docker Hub. By default port 80 will be publicly exposed with the HTTP protocol. The smallest resource plan nf-compute-10 will be enough to get you started.

  4. To store the media you will add to the WordPress site you will have to configure volumes. Inside of your service navigate to Volumes and add a new volume. Choose the name, storage and set the container path to /var/www/html. Save the volume, which will rollout a restart.

    • Volumes are great for persisting data across service restarts. To learn more about them, read our changelog post.

Once the restart is finished, go to the service URL where you will be prompted to create a Wordpress account and configure your site. Happy blogging!

Using Northflank to deploy WordPress with MySQL

Northflank allows you to deploy your code and databases within minutes. Sign up for a Northflank account and create a free project to get started.

  • Multiple read and write replicas
  • Observe & monitor with real-time metrics & logs
  • Low latency and high performance
  • Backup, restore and fork databases
  • Private and optional public load balancing as well as Northflank local proxy

Share this article with your network