Struggling to get n8n running on Heroku platform

Hey everyone,

I’m trying to set up n8n on Heroku but I’m hitting a wall. I’ve been messing around with Docker registry deployment but something’s not clicking. Could use some help figuring this out.

I’ve set up a Postgres database (version 11) manually:

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

My Dockerfile is pretty basic:

FROM n8nio/n8n

I’ve got a heroku.yml file set up with all the config stuff like database settings, timezone, and encryption key. I won’t paste the whole thing here, but it’s pretty standard.

When I try to run it, I’m getting some weird logs:

[WARN  tini (3)] Tini is not running as PID 1 and isn't registered as a child subreaper.
Zombie processes will not be re-parented to Tini, so zombie reaping won't work.
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.
su-exec: setgroups: Operation not permitted

And then it crashes with an H10 error. Any ideas what I’m doing wrong here? Thanks in advance for any help!

I’ve encountered similar issues when deploying n8n on Heroku. The problem likely stems from how Heroku manages container processes. Try modifying your Dockerfile to use the Heroku-specific base image:

FROM heroku/heroku:20

Then, add the necessary n8n installation steps. This approach bypasses the Tini-related warnings. Also, ensure your Procfile is correctly set up:

web: n8n start

Regarding the database, consider using Heroku’s DATABASE_URL environment variable instead of manual configuration. This simplifies the setup and allows for easier scaling.

If issues persist, review your app’s permission settings in the Heroku dashboard. Sometimes, additional configuration is needed for proper execution rights.

As someone who’s gone through the n8n-on-Heroku gauntlet, I feel your pain. The Tini warnings are a red herring - they’re not your main issue. The real culprit is likely how Heroku handles Docker containers.

Here’s what worked for me:

Instead of using the n8n Docker image, build your own image starting with the official Node.js base, then install n8n. This approach gives you more control over the environment.

In your Dockerfile:

FROM node:14
RUN npm install n8n -g
CMD n8n start

Also, consider ditching the heroku.yml file and managing your config vars directly via the Heroku CLI to simplify things.

The H10 error usually indicates that your app is crashing during startup. Be sure to double-check your environment variables, particularly DATABASE_URL, as Heroku can be strict with its configuration.

If you remain stuck, try enabling Heroku’s runtime metrics to gain more insight into what’s causing the crash.