{"id":30092693,"url":"https://github.com/farithadnan/n8n-local","last_synced_at":"2026-05-15T12:08:51.909Z","repository":{"id":308815514,"uuid":"1034202895","full_name":"farithadnan/n8n-local","owner":"farithadnan","description":"Allows you to run n8n in two modes using Docker Compose (Normal or Tunnel)","archived":false,"fork":false,"pushed_at":"2025-08-08T02:56:03.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-08T04:30:03.948Z","etag":null,"topics":["docker","docker-compose","n8n"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/farithadnan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-08T02:49:24.000Z","updated_at":"2025-08-08T02:56:06.000Z","dependencies_parsed_at":"2025-08-08T04:30:11.472Z","dependency_job_id":null,"html_url":"https://github.com/farithadnan/n8n-local","commit_stats":null,"previous_names":["farithadnan/n8n-local"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/farithadnan/n8n-local","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farithadnan%2Fn8n-local","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farithadnan%2Fn8n-local/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farithadnan%2Fn8n-local/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farithadnan%2Fn8n-local/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/farithadnan","download_url":"https://codeload.github.com/farithadnan/n8n-local/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farithadnan%2Fn8n-local/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269548500,"owners_count":24436113,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","n8n"],"created_at":"2025-08-09T08:02:59.970Z","updated_at":"2026-05-15T12:08:46.876Z","avatar_url":"https://github.com/farithadnan.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# n8n Docker Compose Setup\n\nThis setup allows you to run **n8n** in two modes using Docker Compose:\n\n1. **Normal Mode** – Local access only (e.g., http://localhost:5678 or LAN access)\n2. **Tunnel Mode** – Exposes n8n via a secure HTTPS tunnel (required for certain integrations like Telegram)\n\n\nWorkflows, credentials, and settings are stored in a shared Docker volume so you can switch modes without losing data.\n\n---\n## How to Use It\n\n### Start normal mode\n\n```powershell\ndocker compose up -d n8n\n```\n\n### Start tunnel mode\n\n```powershell\ndocker compose up -d n8n_tunnel\n```\n\n**Access Options in Tunnel Mode:**\n- **Local access**: You can still access n8n locally at http://localhost:5678\n- **Public tunnel**: Check the container logs to see the auto-generated tunnel URL\n\n\nTo see the logs and find the auto-generated tunnel URL:\n\n```powershell\ndocker compose logs -f n8n_tunnel\n```\n\nLook for a line in the logs that shows your tunnel URL, typically something like:\n\n```powershell\nTunnel URL: https://your-auto-generated-subdomain.n8n.cloud\n```\n\n#### Important: Tunnel Timeout Considerations\n\nWhen using tunnel mode, you may encounter a **504 Gateway Time-out** error if the container runs idle for extended periods. This happens because:\n\n- n8n uses a built-in tunnel service (n8n.cloud) designed for temporary HTTPS exposure, not always-on operation\n- If there's no activity (workflows, webhooks, etc.) for some time, the tunnel may become inactive\n- When the tunnel times out, external services cannot reach your local container, resulting in 504 errors\n\n**Recommendations:**\n\n- Use tunnel mode primarily for development, testing, or temporary webhook integrations\n- For production or always-on scenarios, consider using a reverse proxy or dedicated hosting\n- If you encounter 504 errors, restart the tunnel service: `docker compose restart n8n_tunnel`\n\n### Switch modes\n\nStop the running container, then start the other mode:\n\n```powershell\ndocker compose down\ndocker compose up -d n8n_tunnel\n```\n\n### Updating n8n\n\nThis will fetch the latest image and restart with your existing data.\n\n```powershell\ndocker compose pull\ndocker compose up -d\n```\n\n---\n\n## How it works\n\nThe docker-compose.yml file defines two services:\n\n- `n8n` → Runs n8n normally, bound to your local network.\n- `n8n_tunnel` → Runs n8n with `--tunnel` enabled to provide a secure HTTPS public URL via n8n.cloud.\n\nBoth services share the same volume:\n\n```yaml\nvolumes:\n  - n8n_data:/home/node/.n8n\n```\n\nThis ensures your workflows and credentials persist across restarts and when switching modes.\n\n### Normal mode\n\n```yaml\nenvironment:\n  - N8N_RUNNERS_ENABLED=true\n```\n\n- `N8N_RUNNERS_ENABLED=true` – Enables task runners to avoid future deprecation issues.\n\nThis mode is great if you only want to use n8n on the same machine or local network.\n\n### Tunnel Mode\n\n```yaml\nenvironment:\n  - N8N_SECURE_COOKIE=false\n  - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true\n  - N8N_TUNNEL_SUBDOMAIN=farithadnan\n  - N8N_HOST=farithadnan.n8n.cloud\n  - N8N_RUNNERS_ENABLED=true\n  - N8N_EXPRESS_TRUST_PROXY=true\n  - N8N_EDITOR_BASE_URL=https://farithadnan.n8n.cloud\ncommand: [start --tunnel]\n```\n\n#### Tunnel \u0026 Networking Config\n- `N8N_TUNNEL_SUBDOMAIN=yourname` – Sets your tunnel URL to `https://yourname.n8n.cloud`\n- `N8N_HOST=yourname.n8n.cloud` – Public hostname n8n binds to (needed for webhook/tunnel routing)\n- `N8N_EDITOR_BASE_URL=https://yourname.n8n.cloud` – Public-facing URL for your n8n editor (used for webhooks, OAuth2 flows, etc.)\n- `start --tunnel` – Runs n8n in tunnel mode, automatically creating a secure HTTPS endpoint\n\n#### Security \u0026 Stability\n\n- `N8N_SECURE_COOKIE=false` – Allows cookies to work over HTTP (development/testing only)\n\n- `N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true` – Enforces correct file permissions\n\n- `N8N_RUNNERS_ENABLED=true` – Enables task runners (future-proof)\n\n- `N8N_EXPRESS_TRUST_PROXY=true` – Allows Express to trust proxy headers (needed in tunnel mode)\n\nThis mode is required when services like **Telegram** need an **HTTPS** webhook URL.\n\n### Environment Variable\n\nVariables for both services are stored in a .`.env` file but you can refer `.env.sample` file for guidance:\n\n```env\n# Shared\nN8N_PORT=5678\nN8N_RUNNERS_ENABLED=true\n\n# Tunnel-specific\nN8N_SECURE_COOKIE=false\nN8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true\nN8N_TUNNEL_SUBDOMAIN=yourname\nN8N_HOST=yourname.n8n.cloud\nN8N_EXPRESS_TRUST_PROXY=true\nN8N_EDITOR_BASE_URL=https://yourname.n8n.cloud\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarithadnan%2Fn8n-local","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarithadnan%2Fn8n-local","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarithadnan%2Fn8n-local/lists"}