I’m finding it difficult to successfully deploy n8n on Heroku through Docker. My attempts keep failing, and I’m not sure where the problem lies. The application crashes right after launch.
For the database, I created a PostgreSQL 11 addon like this:
heroku addons:create heroku-postgresql:hobby-dev --version=11 -a my-app
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:24:54.478493+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=my-app.herokuapp.com
Can anyone offer insights on why the app keeps crashing?
that tini warning is definitely suspicious. try adding USER root and ENTRYPOINT [] before your FROM line, or just switch to a different base image. also, those DB connection vars look like placeholders - heroku won’t swap those out automatically. run heroku config to grab your actual postgres credentials and update your config.
H10 errors usually mean your app isn’t binding to the port Heroku assigns. You’ve got N8N_PORT: "${PORT}" but n8n might not be picking up that environment variable correctly. I ran into the same thing deploying n8n last year. Your heroku.yml has hardcoded database placeholders instead of real PostgreSQL connection details. Heroku creates a DATABASE_URL automatically when you add PostgreSQL - you need to pull the actual credentials from there and set your DB_POSTGRESDB_* variables. Write a startup script to parse DATABASE_URL, or see if n8n can use DATABASE_URL directly. Also double-check your n8n version supports that config format since the syntax changes between versions.
The crash happens because you’re mixing up variable syntax in heroku.yml. Heroku won’t expand shell-style variables like ${SUBDOMAIN}.${DOMAIN_NAME} in the config section - you need actual values or proper Heroku config vars. I hit this exact issue when I deployed n8n on Heroku about 6 months ago. Just set your N8N_HOST to the literal domain: my-app.herokuapp.com. For the database, you’re using placeholder values that won’t work. Run heroku config:get DATABASE_URL to get your real credentials, then parse out the host, database, user, and password. The Tini warning doesn’t matter, but the port binding issue plus invalid database credentials will definitely cause H10 crashes.
Been there with Heroku deployments. The real issue is you’re fighting a platform that wasn’t built for this.
Docker configs, database URL parsing, Heroku’s weird variable handling - it’s all unnecessary complexity. Plus you’re stuck with their infrastructure and pricing.
I moved our workflow automation to Latenode after hitting the same deployment walls. No Docker files, no server babysitting, database connections work automatically. Build workflows, deploy with one click.
Debugging’s way better too. Instead of digging through Heroku logs wondering why your container died, you get real-time execution data and can test individual steps.
Saved our team about 20 hours monthly just on deployment and maintenance. The visual builder’s actually more powerful than n8n once you’re comfortable with it.
Your heroku.yml environment variables are crashing the app. I hit this same issue months ago - Heroku doesn’t process setup config like you’d expect. Those ${SUBDOMAIN} and ${DOMAIN_NAME} variables won’t resolve, so n8n gets garbage config values. Just hardcode N8N_HOST as my-app.herokuapp.com instead of trying variable interpolation. Your database config is broken too - you can’t leave those placeholder values. Either pull the connection details from DATABASE_URL manually or set N8N_DB_POSTGRESDB_CONNECTION_URL to the full DATABASE_URL if n8n supports it. I had better luck with the full connection string than splitting it up. Once you fix the config, the port binding should work fine.