This repository contains a Docker Compose setup for running n8n with Ngrok as a tunneling service. n8n is a workflow automation tool that allows you to connect different services and APIs. Ngrok exposes local servers behind NATs and firewalls to the public internet over secure tunnels.
Before you begin, ensure you have the following installed:
- Docker: Get Docker
- Docker Compose: Install Docker Compose
-
Clone the Repository
Clone this repository to your local machine:
git clone https://github.com/joffcom/n8n-ngrok.git
-
Ngrok Authentication
You need to authenticate with Ngrok. If you don't have an Ngrok account, create one at Ngrok. After creating an account, get your auth token from the Ngrok dashboard.
Set your Ngrok auth token in the
.env
file:NGROK_TOKEN=XXXYYYZZZ
-
Permanent Domain In your Ngrok Dashboard you can reserve a domain, You can do this under Cloud Edge > Domains. Once you have the domain add it to the
.env
file:URL=https://from-ngrok.ngrok-free.app
This will also need to be added to the
ngrok.yml
version: 2 log_level: debug tunnels: n8n: proto: http addr: n8n:5678 domain: from-ngrok.ngrok-free.app
-
Configure n8n
Optionally, you can configure n8n by modifying environment variables in the
docker-compose.yml
file under then8n
service.
To run n8n with Ngrok, use the following command:
docker-compose up
This command will start both n8n and Ngrok services. Ngrok will provide a URL that tunnels to your n8n instance.
After running the Docker Compose command you can access n8n by navigating to this URL in your web browser.
To stop the n8n and Ngrok services, use:
docker-compose down