Skip to content

cakephp/automation

 
 

Repository files navigation

n8n Dokku Maintenance

Run n8n on Dokku

Overview

This guide explains how to deploy n8n, an extendable workflow automation tool, on a Dokku host. Dokku is a lightweight PaaS that simplifies deploying and managing applications using Docker.

Prerequisites

Before proceeding, ensure you have the following:

Setup Instructions

1. Create the App

Log into your Dokku host and create the n8n app:

dokku apps:create n8n

2. Configure the App

Install, Create, and Link PostgreSQL Plugin

  1. Install the PostgreSQL plugin:

    dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
  2. Create a PostgreSQL service:

    dokku postgres:create n8n
  3. Link the PostgreSQL service to the app:

    dokku postgres:link n8n n8n

Set the Encryption Key

Generate and set an encryption key for n8n:

dokku config:set n8n N8N_ENCRYPTION_KEY=$(echo `openssl rand -base64 45` | tr -d \=+ | cut -c 1-32)

Set the Webhook URL

Set the webhook URL for your n8n instance:

dokku config:set n8n WEBHOOK_URL=http://n8n.example.com

3. Configure the Domain and Ports

Set the domain for your app to enable routing:

dokku domains:set n8n n8n.example.com

Map the internal port 5678 to the external port 80:

dokku ports:set n8n http:80:5678

4. Deploy the App

You can deploy the app to your Dokku server using one of the following methods:

Option 1: Deploy Using dokku git:sync

If your repository is hosted on a remote Git server with an HTTPS URL, you can deploy the app directly to your Dokku server using dokku git:sync. This method also triggers a build process automatically. Run the following command:

dokku git:sync --build n8n https://github.com/d1ceward-on-dokku/n8n_on_dokku.git

This will fetch the code from the specified repository, build the app, and deploy it to your Dokku server.

Option 2: Clone the Repository and Push Manually

If you prefer to work with the repository locally, you can clone it to your machine and push it to your Dokku server manually:

  1. Clone the repository:

    # Via HTTPS
    git clone https://github.com/d1ceward-on-dokku/n8n_on_dokku.git
  2. Add your Dokku server as a Git remote:

    git remote add dokku [email protected]:n8n
  3. Push the app to your Dokku server:

    git push dokku master

Choose the method that best suits your workflow.

5. Enable SSL (Optional)

Secure your app with an SSL certificate from Let's Encrypt:

  1. Add the HTTPS port:

    dokku ports:add n8n https:443:5678
  2. Install the Let's Encrypt plugin:

    dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
  3. Set the contact email for Let's Encrypt:

    dokku letsencrypt:set n8n email [email protected]
  4. Enable Let's Encrypt for the app:

    dokku letsencrypt:enable n8n

Wrapping Up

Congratulations! Your n8n instance is now up and running. You can access it at https://n8n.example.com.

For more information about n8n, visit the official documentation.

About

Dockerfile to run n8n (automation) on Dokku (mini-Heroku)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 93.8%
  • Dockerfile 6.2%