Deploying Coder on

Deploy Coder on is a platform for deploying applications to the edge. It’s a great fit for Coder because it’s easy to deploy and scale, and it’s easy to manage. In this guide, we’ll walk through deploying Coder on


Deploy Coder

  1. Log in to with the CLI:
flyctl auth login
  1. Create a new fly postgres database:
flyctl postgres create DATABASE-NAME
  1. Create a new fly app:
flyctl apps create APP-NAME
  1. Connect to the database with the coder fly app:
flyctl postgres connect DATABASE-NAME --app APP-NAME

This will print out a connection string. Copy the connection string and save it to be used in the next step.

  1. Edit the fly.toml file and update as per the example below:
app = "APP-NAME"
kill_signal = "SIGINT"
kill_timeout = 5
primary_region = "ams"  # See a list of regions here:

  auto_rollback = true
  private_network = true  # This is needed for Coder to connect to the database

   image = ""

  CODER_ACCESS_URL = "" # make sure to replace APP-NAME with your app name
  #CODER_VERBOSE = "true" # Uncomment this if you want to see more logs

  protocol = "tcp"
  internal_port = 3000
  processes = ["app"]

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

    port = 443
    handlers = ["tls", "http"]
    type = "connections"
    hard_limit = 25

  1. Deploy the app:

Run the following command to deploy the app from the directory where the fly.toml file is located:

flyctl deploy
  1. Scale the to use more memory:
flyctl scale memory 1024 --app APP-NAME
  1. Go to the URL of your app and start using Coder!

If you want to use a custom domain, you can do so by following the instructions here.

Update Coder

To update the Coder version, run flyctl deploy --aap APP-NAME again and it will pull the latest version of Coder.

Congratulations! You’ve deployed Coder on!

Next Steps

To write your first coder template, check out the template docs.
We have an official template that you can use as a starting point.

Isn’t it like a terrible idea to add the PG connection string to the fly.toml file?

That should go into the secrets.


It is already in the secrets as DATABASE_URL but I was unable to use that for CODER_PG_CONNECTION_URL .
Any suggestions are welcomed.

Why don’t you just use CODER_PG_CONNECTION_URL in the secrets? :thinking:

1 Like

But I have one question will this be passed as an env variable to the docker image?
The coder docker container needs this to connect to the pg database.

tested this and it works. Thank you @pier. I want to edit the post to reflect this change

1 Like