Hosting on heroku

Hi ,
I am working on a tutorial to host n8n on heroku Host your own Zapier on Heroku. What you will need | by DeFi VC | Medium

In the last step when I check the deployment status, I am unable to see the app running on heroku, I instead see the default heroku app screen as follows

Welcome to the community @neuromancer1729!

Thanks a lot for working on this! Sadly did I never use Heroku so I can not tell you what exactly is going wrong. Expect, however, that the issue is related that it starts on a different port than you expect. n8n runs by default on port 5678 but you do not mention it anywhere in your guide. So do not know how Heroku would know about that and I would say it can not work.
If that is not the problem or something else is still not working, it is maybe a good idea to check out the following documentation and guides. Maybe reading through them helps you figure out what could be missing or is wrong:

Additionally is here also the default docker-compose setup. Maybe you find also something there that helps:

1 Like

Heroku apps have random port assigned - see this question on Stackoverflow.

Also - PG needs to be version 11, I haven’t figured proper settings in heroku.yml so I provison it manually (one time job) with following command:

heroku addons:create heroku-postgresql:hobby-dev --version=11 -a my-app

Here is my heroku.yml:

setup:
  #addons:
  #  - plan: heroku-postgresql:hobby-dev
  #    version: 11
  #    as: DATABASE
  config:
    SUBDOMAIN: "my-app"
    DOMAIN_NAME: "herokuapp.com"
    NODE_ENV: "production"
    TZ: "Europe/Berlin"
    GENERIC_TIMEZONE: "Europe/Berlin"
    N8N_HOST: "${SUBDOMAIN}.${DOMAIN_NAME}"
    N8N_PORT: "${PORT}"
    N8N_PROTOCOL: "https"
    N8N_ENCRYPTION_KEY: "mysupersecretkey"
    WEBHOOK_TUNNEL_URL: "https://${SUBDOMAIN}.${DOMAIN_NAME}/"
    VUE_APP_URL_BASE_API: "https://${SUBDOMAIN}.${DOMAIN_NAME}/"
    DB_TYPE: "postgresdb"
    DB_POSTGRESDB_HOST: "dbhost"
    DB_POSTGRESDB_DATABASE: "dbname"
    DB_POSTGRESDB_PORT: 5432
    DB_POSTGRESDB_USER: "dbuser"
    DB_POSTGRESDB_PASSWORD: "dbpass"

build:
    docker:
        web: Dockerfile

Command

heroku logs --tail

returns

2020-04-15T11:19:50.178271+00:00 app[web.1]: [WARN  tini (3)] Tini is not running as PID 1 and isn't registered as a child subreaper.
2020-04-15T11:19:50.178300+00:00 app[web.1]: Zombie processes will not be re-parented to Tini, so zombie reaping won't work.
2020-04-15T11:19:50.178302+00:00 app[web.1]: To fix the problem, use the -s option or set the environment variable TINI_SUBREAPER to register Tini as a child subreaper, or run Tini as PID 1.
2020-04-15T11:19:50.179480+00:00 app[web.1]: su-exec: setgroups: Operation not permitted
2020-04-15T11:24:54.478493+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=my-app.herokuapp.com request_id=myid fwd="myip" dyno= connect= service= status=503 bytes= protocol=https

@metalcamp I think I replied to your question on stackoverflow, please check and let me know if it helps!

@neuromancer1729 this may help you too.
github repo for the same - GitHub - sarveshpro/n8n-heroku: n8n docker implementation for heroku.

3 Likes

Thank you for this solution @sarvesh!

Do you know how I can update the version of n8n when it is hosted on heroku? I have version 0.98.0 and I’m missing some useful triggers.

Thank you!

@Gaetan_Fizero you need to update the Dockerfile and redeploy, if you are using a db, you won’t lose any workflows.

Can you explain me how to do that please?
Docker is really new to me.

Thank you!

update N8N_VERSION in this line in your Dockerfile to the desired version. latest being 0.108.0
ARG N8N_VERSION=0.98.0

2 Likes

Thank you!!

Hi @sarvesh,

Your github repo seems to have problems, because i can’t open my app anymore neither yours.

Thank you for your help.