├── n8n_logo.png ├── heroku.yml ├── Dockerfile ├── README.md ├── LICENSE ├── entrypoint.sh └── app.json /n8n_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n8n-io/n8n-heroku/HEAD/n8n_logo.png -------------------------------------------------------------------------------- /heroku.yml: -------------------------------------------------------------------------------- 1 | setup: 2 | addons: 3 | - plan: heroku-postgresql 4 | as: DATABASE 5 | 6 | build: 7 | docker: 8 | web: Dockerfile -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM n8nio/n8n:latest 2 | 3 | USER root 4 | 5 | WORKDIR /home/node/packages/cli 6 | ENTRYPOINT [] 7 | 8 | COPY ./entrypoint.sh / 9 | RUN chmod +x /entrypoint.sh 10 | CMD ["/entrypoint.sh"] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # n8n-heroku 2 | 3 | [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://dashboard.heroku.com/new?template=https://github.com/n8n-io/n8n-heroku/tree/main) 4 | 5 | ## n8n - Free and open fair-code licensed node based Workflow Automation Tool. 6 | 7 | This is a [Heroku](https://heroku.com/)-focused container implementation of [n8n](https://n8n.io/). 8 | 9 | Use the **Deploy to Heroku** button above to launch n8n on Heroku. When deploying, make sure to check all configuration options and adjust them to your needs. It's especially important to set `N8N_ENCRYPTION_KEY` to a random secure value. 10 | 11 | Refer to the [Heroku n8n tutorial](https://docs.n8n.io/hosting/server-setups/heroku/) for more information. 12 | 13 | If you have questions after trying the tutorials, check out the [forums](https://community.n8n.io/). 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 n8n GmbH 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # check if port variable is set or go with default 4 | if [ -z ${PORT+x} ]; then echo "PORT variable not defined, leaving N8N to default port."; else export N8N_PORT="$PORT"; echo "N8N will start on '$PORT'"; fi 5 | 6 | # regex function 7 | parse_url() { 8 | eval $(echo "$1" | sed -e "s#^\(\(.*\)://\)\?\(\([^:@]*\)\(:\(.*\)\)\?@\)\?\([^/?]*\)\(/\(.*\)\)\?#${PREFIX:-URL_}SCHEME='\2' ${PREFIX:-URL_}USER='\4' ${PREFIX:-URL_}PASSWORD='\6' ${PREFIX:-URL_}HOSTPORT='\7' ${PREFIX:-URL_}DATABASE='\9'#") 9 | } 10 | 11 | # prefix variables to avoid conflicts and run parse url function on arg url 12 | PREFIX="N8N_DB_" parse_url "$DATABASE_URL" 13 | echo "$N8N_DB_SCHEME://$N8N_DB_USER:$N8N_DB_PASSWORD@$N8N_DB_HOSTPORT/$N8N_DB_DATABASE" 14 | # Separate host and port 15 | N8N_DB_HOST="$(echo $N8N_DB_HOSTPORT | sed -e 's,:.*,,g')" 16 | N8N_DB_PORT="$(echo $N8N_DB_HOSTPORT | sed -e 's,^.*:,:,g' -e 's,.*:\([0-9]*\).*,\1,g' -e 's,[^0-9],,g')" 17 | 18 | export DB_TYPE=postgresdb 19 | export DB_POSTGRESDB_HOST=$N8N_DB_HOST 20 | export DB_POSTGRESDB_PORT=$N8N_DB_PORT 21 | export DB_POSTGRESDB_DATABASE=$N8N_DB_DATABASE 22 | export DB_POSTGRESDB_USER=$N8N_DB_USER 23 | export DB_POSTGRESDB_PASSWORD=$N8N_DB_PASSWORD 24 | 25 | # kickstart nodemation 26 | n8n -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "n8n", 3 | "description": "deploy n8n to heroku without any hassle", 4 | "keywords": [ 5 | "n8n", 6 | "node", 7 | "automation" 8 | ], 9 | "website": "https://n8n.io", 10 | "repository": "https://github.com/n8n-io/n8n-heroku", 11 | "logo": "https://raw.githubusercontent.com/n8n-io/n8n-heroku/main/n8n_logo.png", 12 | "success_url": "/", 13 | "stack": "container", 14 | "env": { 15 | "GENERIC_TIMEZONE": { 16 | "description": "Time Zone to use with Heroku. You can find the name of your timezone for example here: https://momentjs.com/timezone/.", 17 | "value": "Europe/Berlin" 18 | }, 19 | "N8N_ENCRYPTION_KEY": { 20 | "description": "Set the n8n encryption key to a static value to avoid Heroku overriding it (causing authentication to fail).", 21 | "value": "change-me-to-something-else" 22 | }, 23 | "WEBHOOK_URL": { 24 | "description": "Replace with your Heroku application name. This will ensure the correct webhook URLs are being shown in n8n.", 25 | "value": "https://.herokuapp.com" 26 | }, 27 | "DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED": { 28 | "description": "SSL is required to connect to Postgres on Heroku", 29 | "value": "false" 30 | } 31 | }, 32 | "addons": [ 33 | { 34 | "plan": "heroku-postgresql", 35 | "options": { 36 | "version": "14" 37 | } 38 | }, 39 | { 40 | "plan": "papertrail:choklad" 41 | } 42 | ] 43 | } 44 | --------------------------------------------------------------------------------