Docker compose file to create a n8n with PostgreSQL and Localtunnel
This repository contains a Docker Compose file that sets up n8n (a workflow automation tool) using PostgreSQL as the database backend and Localtunnel to expose n8n to the public internet.
Before you begin, ensure you have Docker and Docker Compose installed on your system. For installation instructions, refer to the official Docker documentation.
To get started with this setup, clone this repository and navigate into the directory:
git clone https://github.com/AllanAV/docker-compose-n8n-postgres-lt.git
cd docker-compose-n8n-postgres-ltIMPORTANT: Before you do that change the default users and passwords in the .env file!
To start all services, run the following command in the root of this directory:
docker-compose up -dThis command will start all required services in the background.
Once the services are running, you can access n8n locally by opening http://localhost:5678.
WARNING: Use for local development and testing only. DO NOT use in production!
https://github.com/n8n-io/localtunnel redirects requests from lt servers to your local n8n instance, making n8n reachable from the web enabling the use of webhooks with all triggers of external services. As long as your local instance of lt remains active, any requests will be routed to your local service at the specified port. The URL can be obtained from the Localtunnel logs, by running:
docker-compose logs -f ltLook for a line similar to:
your localtunnel url is: https://<random_subdomain>.loca.ltVisit this URL in your web browser to access n8n.
Access to the tunnel is restricted by password, which can be retrieved by accessing https://loca.lt/mytunnelpassword Use this password when prompted.
To stop and remove the containers, use:
docker-compose downTo update n8n to the latest version, follow the steps provided in the official n8n Docker Update documentation.
- n8n Docker setup with PostgreSQL: n8n official GitHub repository
- Localtunnel with Docker Compose tutorial: LocalTunnel.me with Docker Compose
- The official n8n documentation can be found under: https://docs.n8n.io
- Additional information and example workflows on the n8n.io website: https://n8n.io