
n8n is an open-source workflow automation platform that connects applications and automates tasks without coding. It offers a visual node-based interface for building complex workflows, supports over 400 integrations, and provides self-hosted deployment for complete data privacy. n8n enables teams to automate repetitive processes, synchronize data between services, and build custom business logic.
In this article, you will deploy n8n using Docker Compose, configure persistent storage for workflow data, and set up Traefik as a reverse proxy to securely access your n8n instance.
Before you begin, you need to:
sudo privileges.n8n.example.com).In this section, you prepare the required directory structure for n8n and define environment variables in a .env file.
Create the directory structure for n8n.
This directory stores workflow definitions, credentials, and execution history.
Navigate into the n8n-automation directory.
Set proper ownership for the n8n data directory. n8n runs as the node user (UID 1000) inside the container.
Create a .env file.
Add the following variables:
Replace:
n8n.example.com with your domain.admin@example.com with your email.Save and close the file.
In this section, you create and deploy the Docker Compose stack that runs n8n behind Traefik. Docker Compose manages both containers, applies the environment variables from your .env file, and automatically configures HTTPS routing through Traefik.
Create a new Docker Compose manifest.
Add the following content.
Save and close the file.
This manifest defines:
./n8n-data) persists workflow configurations, encrypted credentials, and execution logs.letsencrypt retains SSL certificate data across restarts..env file for hostname, protocol, and webhook URL configuration.Create and start the services.
Verify that the services are running.
Output:
Both containers are running. n8n processes workflows while Traefik handles connections on ports 80 and 443.
View the logs of the services.
For more information on managing a Docker Compose stack, see the How To Use Docker Compose article.
This section demonstrates accessing the n8n web interface and creating your initial administrator account to begin building automated workflows.
Open the n8n web interface in your browser.
Create an owner account by providing your email address and a secure password. This account has full administrative access to all workflows and credentials.
After account creation, the n8n dashboard displays a welcome screen.
You have successfully deployed n8n for workflow automation with HTTPS encryption. The Docker Compose configuration pairs the automation engine with an automatic SSL reverse proxy, while persistent volumes preserve your workflows and credentials through container updates. Traefik manages certificate renewal and traffic routing seamlessly. Your n8n instance is ready to connect applications, automate business processes, and execute scheduled tasks through its extensive integration library.
0 Comments
Be the first to comment and share your perspective with the community.