@@ -17,39 +17,37 @@ sudo docker run -d \
17
17
--restart=always mqtt
18
18
```
19
19
20
- The server is now running.
20
+ Add this to command above if you use SSH:
21
21
22
- # Using SSL with Let's Encrypt
22
+ ```
23
+ -e SSL_DOMAIN=YOUR_MQTT_SERVER_HOSTNAME_HERE
24
+ ```
23
25
24
- ** STEP 1: **
26
+ The server is now running.
25
27
26
- SSH into the runing docker container ( ` docker exec -i -t CONTAINER_ID_HERE /bin/bash ` )
28
+ # Renewing SSL Certs with Let's Encrypt
27
29
28
- ** STEP 2 :**
30
+ ** NOTE :** I have made a script, ` letsencrypt_renewal.sh ` to help.
29
31
30
- From inside the container, run:
32
+ ** Step 1 **
31
33
32
- ``` shell
34
+ SSH into the runing docker container ( ` docker exec -i -t CONTAINER_ID_HERE /bin/bash ` )
33
35
34
- letsencrypt certonly --webroot \
35
- -w /app/public \
36
- -d SSL_DOMAIN_HERE \
37
- --text \
38
- --non-interactive \
39
- --agree-tos \
40
- --email SSL_EMAIL_HERE
36
+ ** Step 2**
41
37
42
- ```
38
+ Run ` letsencrypt renew ` within 90 day. There is a ` --force ` flag if you care to use it.
43
39
44
- ** Step 3: **
40
+ ** Step 3**
45
41
46
- Exit from the shell session (` exit ` ) and set the ` SSL_DOMAIN ` .
42
+ Kill the container. ` docker kill CONTAINER_NAME ` .
43
+ Re-run the container, this time with two extra ENV vars:
44
+
45
+ ``` shell
47
46
48
- You can accomplish this by running the same command during setup (see top of document), but this time add an additional flag to ` docker run ` :
49
- ```
50
47
sudo docker run -d \
51
48
-e WEB_API_URL=http://YOUR_API_URL_HERE \
52
- -e SSL_DOMAIN=YOUR-MQTT-DOMAIN-HERE \
49
+ -e SSL_DOMAIN=YOUR_MQTT_URL_HERE \
50
+
53
51
-p 3002:3002 \
54
52
-p 8883:8883 \
55
53
-p 1883:1883 \
@@ -58,29 +56,38 @@ sudo docker run -d \
58
56
-v /etc/letsencrypt/:/etc/letsencrypt/ \
59
57
--restart=always mqtt
60
58
```
61
- # Renewing SSL Certs with Let's Encrypt
62
59
63
- ** NOTE: ** I have made a script, ` letsencrypt_renewal.sh ` to help.
60
+ # Adding SSL to New Setups with Let's Encrypt
64
61
65
- ** Step 1 **
62
+ ** STEP 1: **
66
63
67
- SSH into the runing docker container (` docker exec -i -t CONTAINER_ID_HERE /bin/bash ` )
64
+ SSH into the runing docker container (` docker exec -i -t CONTAINER_ID_HERE /bin/bash ` )
68
65
69
- ** Step 2 **
66
+ ** STEP 2: **
70
67
71
- Run ` letsencrypt renew ` within 90 day. There is a ` --force ` flag if you care to use it.
68
+ From inside the container, run:
72
69
73
- ** Step 3 **
70
+ ``` shell
74
71
75
- Kill the container. ` docker kill CONTAINER_NAME ` .
76
- Re-run the container, this time with two extra ENV vars:
72
+ letsencrypt certonly --webroot \
73
+ -w /app/public \
74
+ -d SSL_DOMAIN_HERE \
75
+ --text \
76
+ --non-interactive \
77
+ --agree-tos \
78
+ --email SSL_EMAIL_HERE
77
79
78
- ``` shell
80
+ ```
79
81
82
+ ** Step 3:**
83
+
84
+ Exit from the shell session (` exit ` ) and set the ` SSL_DOMAIN ` .
85
+
86
+ You can accomplish this by running the same command during setup (see top of document), but this time add an additional flag to ` docker run ` :
87
+ ```
80
88
sudo docker run -d \
81
89
-e WEB_API_URL=http://YOUR_API_URL_HERE \
82
- -e SSL_DOMAIN=YOUR_MQTT_URL_HERE \
83
-
90
+ -e SSL_DOMAIN=YOUR-MQTT-DOMAIN-HERE \
84
91
-p 3002:3002 \
85
92
-p 8883:8883 \
86
93
-p 1883:1883 \
0 commit comments