Fork: This is a fork from https://github.com/sarveshpro/n8n-heroku. We forked to provide a working setup for Heroku, because it wasn't working. (works as of December 18, 2020)
New method, just click, configure and get your n8n running. Also, now set app stack to container and simply connect this Github repo and deploy, heroku uses default configuration from app.json
default basic auth is user:pass
You can see the online demo running on Heroku at https://unly-n8n-demo.herokuapp.com/ (credentials: user
/pass
)
This is a Heroku focused container implementation for the n8n Automation Tool. Just connect your fork of this repo to heroku and let it work as a charm!
- Heroku CLI
this is old setup guide not required now, connect this Github repo to heroku to auto configure. or click the above button to deploy without Github.
you can change your app's stack using heroku cli, make sure you have heroku cli installed.
heroku login
heroku stack:set contaner --app APP_NAME
replace APP_NAME with your heroku app name
It's recommended that you enable basic authentication when deployingn n8n on web. You need to set the following Environment Variables(Config Vars) in your App settings.
N8N_BASIC_AUTH_ACTIVE=true
N8N_BASIC_AUTH_USER=SET_USERNAME
N8N_BASIC_AUTH_PASSWORD=SET_PASSWORD
Using filesystem/sqlite as storage will destroy any workflows on new builds/releases it it recommended to use mongodb or postgreSQL as the drivers are built into the code.
DB_TYPE=mongodb
DB_MONGODB_CONNECTION_URL=mongodb://MONGODB_USERNAME:MONGODB_PASSWORD@HOST:PORT/MONGODB_DATABASE
you will get the connection string in the heroku mongodb addon or any service you choose. using heroku addons is recommended as they auto configure ENV Variables for you. just copy MONGODB_URI to DB_MONGODB_CONNECTION_URL. that's it.
Same process is to be followed for using postgreSQL.
DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=POSTGRES_HOST
DB_POSTGRESDB_PORT=POSTGRES_PORT
DB_POSTGRESDB_DATABASE=POSTGRES_DB
DB_POSTGRESDB_USER=POSTGRES_USER
DB_POSTGRESDB_PASSWORD=POSTGRES_PASSWORD
you can also deploy this project using container registry (requires aditional requirements installed). Just clone/download this repository on your local machine.
- docker
- docker-compose
cd into your project directory
cd n8n-heroku-demo/
login into heroku account
heroku login
create heroku app
heroku create APP_NAME
change app stack
heroku stack:set container --app APP_NAME
set config vars(optional)
heroku config:set N8N_BASIC_AUTH_ACTIVE=true
heroku config:set N8N_BASIC_AUTH_USER=SET_USERNAME
heroku config:set N8N_BASIC_AUTH_PASSWORD=SET_PASSWORD
Login the container
heroku container:login
build and push container image to heroku
heroku container:push web --app APP_NAME
release new build
heroku container:release web --app APP_NAME
Maybe now you can specify which N8N version to install by Setting a Environment Variable N8N_VERSION or with a build time argument of the same. Not tested yet though, create an issue if it does't work. CI is passing so it is working correctly with default values.
Update - To set n8n version you can pass a argument when deploying using container registry
heroku container:push web --arg N8N_VERSION=0.60.0 --app APP_NAME