I’m having trouble deploying N8N on Heroku using the one-click method. After following the docs and setting up SSL, I’m getting an H10 error. Heroku support says it’s an app code issue, but I didn’t change anything.
I tried updating the database config with:
heroku config:set DB_HOST=example_host DB_USER=example_user DB_NAME=example_db -a myapp
But it’s still not working. Here’s part of the error log:
Error: DB initialization failed
DatabaseError: no pg_hba.conf entry for host "52.211.32.179", user "USER", database "MYDATABASE", no encryption
Process exited with status 1
State changed from starting to crashed
The router logs show H10 errors for both the main page and favicon.
Has anyone successfully deployed N8N on Heroku recently? Any tips on fixing this or alternative deployment methods would be great. I’m stuck and not sure what to try next.
yo, i had the same prob with n8n on heroku. try checkin ur pg_hba.conf file, it mite be blockin connections. also, make sure ur using the right postgres addon for heroku. if all else fails, docker on digitalocean worked great for me. good luck man!
Hey there, I feel your pain with N8N on Heroku. Been there, done that. One thing that worked for me was tweaking the Procfile. Try adding this line:
web: n8n start
Also, make sure you’ve got the right buildpacks. You need both nodejs and apt. Run these commands:
heroku buildpacks:clear
heroku buildpacks:add heroku/nodejs
heroku buildpacks:add heroku/apt
If that doesn’t do the trick, you might want to look into your database connection. Sometimes Heroku’s default connection string doesn’t play nice with N8N. Try manually setting it like this:
heroku config:set DATABASE_URL=$(heroku config:get DATABASE_URL)
Hope this helps. Deployment can be a real headache sometimes, but stick with it!
I’ve encountered similar issues when deploying N8N on Heroku. One thing that helped me was explicitly setting the DATABASE_URL environment variable. Try running:
heroku config:set DATABASE_URL=postgres://username:password@host:port/database_name -a your_app_name
Replace the placeholders with your actual database credentials. This ensures N8N can properly connect to your Postgres instance.
Also, double-check your Heroku Config Vars to make sure all necessary environment variables are set correctly. Sometimes, the one-click deploy misses a few crucial ones.
If that doesn’t work, you might want to consider deploying N8N on a different platform like DigitalOcean or AWS. They often provide more flexibility and control over the deployment environment, which can be helpful for troubleshooting these kinds of issues.