File tree 5 files changed +55
-8
lines changed
5 files changed +55
-8
lines changed Original file line number Diff line number Diff line change @@ -5,4 +5,10 @@ DOCKER_UID=1000
5
5
DOCKER_GID=1000
6
6
7
7
# Public URL of the server
8
- PUBLIC_URL=http://n8n.localhost
8
+ PUBLIC_URL=http://localhost
9
+
10
+ # N8N encryption key
11
+ N8N_ENCRYPTION_KEY=
12
+
13
+ # Options to forward to N8N
14
+ N8N_OPTIONS="--tunnel"
Original file line number Diff line number Diff line change
1
+ # Self-hosted N8N
2
+
3
+ This repository is a starter-pack to get a self-hosted N8N instance with:
4
+ - A containerized setup (docker)
5
+ - An export/import workflow to export/import current workflows and credentials to local folders
6
+ - A persistent encryption key to keep your credentials across losing your container
7
+
8
+ ## Install
9
+
10
+ ``` bash
11
+ # 1. Clone the repository
12
+ git clone https://github.com/7PH/n8n-self-hosted.git
13
+ cd n8n-self-hosted
14
+
15
+ # 2. Copy `.env.template` to `.env` and tweak the environment variables
16
+ # In particular, ensure `N8N_ENCRYPTION_KEY` is set
17
+ cp .env.template .env
18
+
19
+ # 3. Run `docker compose up`
20
+ docker compose up
21
+ ```
Original file line number Diff line number Diff line change @@ -2,9 +2,10 @@ version: '3.8'
2
2
3
3
4
4
services :
5
- # /n8n
6
5
n8n :
7
6
container_name : n8n
7
+ cap_drop :
8
+ - ALL
8
9
ports :
9
10
- 80:80
10
11
build :
@@ -13,8 +14,8 @@ services:
13
14
DOCKER_USER : " ${DOCKER_USER}"
14
15
DOCKER_UID : " ${DOCKER_UID}"
15
16
DOCKER_GID : " ${DOCKER_GID}"
16
- labels :
17
- - " traefik.enable=true "
17
+ env_file :
18
+ - .env
18
19
volumes :
19
20
- ./credentials/:/app/credentials:rw
20
21
- ./workflows/:/app/workflows:rw
Original file line number Diff line number Diff line change 2
2
3
3
n8n import:credentials --separate --input=credentials
4
4
n8n import:workflow --separate --input=workflows
5
- n8n start --tunnel
5
+ n8n start $N8N_OPTIONS
Original file line number Diff line number Diff line change 1
1
{
2
2
"createdAt" : " 2023-01-02T10:29:34.090Z" ,
3
- "updatedAt" : " 2023-01-05T01:12:55.194Z " ,
3
+ "updatedAt" : " 2023-01-05T01:14:44.000Z " ,
4
4
"id" : 2 ,
5
5
"name" : " internal/import" ,
6
6
"active" : false ,
28
28
],
29
29
"typeVersion" : 1 ,
30
30
"id" : " 699de5bc-17fc-4383-b060-3890fa70bf67"
31
+ },
32
+ {
33
+ "parameters" : {
34
+ "command" : " npx n8n import:credentials --separate --input=credentials"
35
+ },
36
+ "name" : " Import Credentials" ,
37
+ "type" : " n8n-nodes-base.executeCommand" ,
38
+ "position" : [
39
+ 860 ,
40
+ 340
41
+ ],
42
+ "typeVersion" : 1 ,
43
+ "id" : " 51a48ad2-1744-4a60-a3f3-78c11b8fefe8"
31
44
}
32
45
],
33
46
"connections" : {
44
57
},
45
58
"Import Workflows" : {
46
59
"main" : [
47
- []
60
+ [
61
+ {
62
+ "node" : " Import Credentials" ,
63
+ "type" : " main" ,
64
+ "index" : 0
65
+ }
66
+ ]
48
67
]
49
68
}
50
69
},
51
70
"settings" : {},
52
71
"staticData" : null ,
53
72
"dataLoaded" : false ,
54
73
"pinData" : {},
55
- "versionId" : " f79b1bbb-ad69-4ef9-8e11-786289a59e05 " ,
74
+ "versionId" : " ee13fa9e-3eef-4745-a33b-5b67fa5b5deb " ,
56
75
"triggerCount" : 0 ,
57
76
"tags" : [
58
77
{
You can’t perform that action at this time.
0 commit comments