- A Heroku account
- Heroku CLI installed
-
Create a new Heroku app by using our deploy button below. This will automatically create a new app and deploy the latest version of Coder to it along with a basic postgres database.
-
Enable dyno metadata by running the following command in the terminal:
heroku labs:enable runtime-dyno-metadata -a <app-name>
Note:
HEROKU_APP_NAME
is required by Coder to configure theCODER_ACCESS_URL
environment variable. This is made available by enabling dyno metadata. -
Clone the repository to your local machine and connect it to your Heroku app by running the following commands in the terminal:
git clone https://githib.com/coder/packages heroku git:remote -a <app-name>
-
Push the repository to Heroku by running the following command in the terminal:
git push heroku main
-
Once the deployment is complete, you can access your Coder instance by going to
https://<app-name>.herokuapp.com
.
We have an example community template that you can use to create your first workspace deployed as an ephemeral heroku worker dyno. Follow the steps below to create your first workspace:
-
Install Coder locally by running the following command in the terminal:
Linux / macOS:
curl -fsSL https://coder.com/install.sh | sh
Windows:
winget install Coder.Coder
-
Login to your Coder instance by running the following command in the terminal:
coder login https://<app-name>.herokuapp.com
-
Clone the repository and change into the directory:
git clone https://github.com/matifali/coder-templates cd coder-templates/heroku-worker-dyno
-
Create the template:
coder template create heroku-worker-dyno
-
Create a workspace using the template from the Coder dashboard or by running the following command:
coder create heroku-workspace --template heroku-worker-dyno --variable heroku_api_key=<heroku-api-key>
Replace
<heroku-api-key>
with your Heroku API key. You can create a new API key by going to your account settings.
If you want to update Coder to the latest version, you can redeploy your app by running the following command from the root of your repository:
git pull origin main
git push heroku main
-
Check out our documentation to learn how to configure your Coder instance.
-
You can add environment variables to an Heroku app by going to the app's settings page and clicking on the "Reveal Config Vars" button.
Note: Replace
<app-name>
with the name of your Heroku app.