Deploy a free WordPress on is a very easy to use SaaS platform like Heroku, which offers a few free allowances for startup.

  • Up to 3 shared-cpu-1x 256mb VMs
  • 3GB persistent volume storage (total)
  • 160GB outbound data transfer

That means we can create up to 3 small apps, each app with 256MB of RAM and using a one shared CPU.

More about free allowances.

Let’s Get Started!

We will create two applications: MySQL and WordPress, also need to create two volumes to store database data and uploaded files. The code for this article is on blackstorm/wordpress-fly


I was using Google Cloud Shell for this tutorial which provided a running on browser editor and pre-installed several helpful components like Docker / Kubectl.

Or you can manually install the require components on your local machine.

Our workspace directory like this.

├── database
│   └── fly.toml
└── wordpress
    └── fly.toml

Launch MySQL

We are going to use the official MySQL image. There are a few main things done here.

  1. Set the default database name and root user password (You can change it)
  2. Add some configs to support MySQL running on small memory instance.
  3. Mount data volume.
app = "mysql-database"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
  MYSQL_ROOT_PASSWORD = "my-secret-pw"
  image = "mysql:8"
  cmd = [
      "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci", "--default-authentication-plugin", "mysql_native_password", "--datadir", "/data/mysql"]
  destination = "/data"
  source = "mysqldata"

Don’t forget to create a volume before launch MySQL. We can use up to 2GB volume. Here recommend using 1GB for the database.

fly volumes create mysqldata --size 1

Now release MySQL

fly launch

Launch WordPress

app = "wordpress"

  WORDPRESS_DB_HOST = "mysql-database.internal"
  WORDPRESS_DB_PASSWORD = "my-secret-pw"

  destination = "/var/www/html"
  source = "wordpressdata"

  image = "wordpress:6-php8.0-apache"

  internal_port = 80
  protocol = "tcp"
    hard_limit = 50
    soft_limit = 25

    handlers = ["tls", "http"]
    port = 443

    handlers = ["http"]
    port = 80
    force_https = true

    grace_period = "1s"
    interval = 5000
    timeout = 2000

Like create MySQL, before launch the WordPress instance we need create a volume for file store first. Here you can use 1GB or 2GB, depending mainly on the free volume left in your account.

fly volumes create wordpressdata --size 1

Launch WordPress

fly launch

After successfully launching, you may need to bind a domain. It is easy to bind a domain and will obtain and renew SSL for the domain automatically.

Watch your bill

The key to making the plan free is to follow the free allowance.


Leave a Reply

Your email address will not be published.