tacticalrmm/docker/readme.md

69 lines
2.3 KiB
Markdown
Raw Normal View History

2020-02-12 16:18:43 +00:00
# Docker Setup
2020-11-20 00:03:44 +00:00
- Install docker and docker-compose
2020-11-20 15:21:45 +00:00
- Optional (but strongly recommended) obtain valid wildcard certificate for domain. If certificates are not provided, a self-signed cert will be generated. See below on how to generate a free Let's Encrypt!
2020-02-12 16:18:43 +00:00
2020-11-20 00:03:44 +00:00
## (Optional) Generate certificates with certbot
2020-02-12 16:18:43 +00:00
Install Certbot
2020-04-06 18:21:52 +00:00
```
2020-02-12 16:18:43 +00:00
sudo apt-get install certbot
```
2020-11-20 00:03:44 +00:00
Generate the wildcard certificate. Add the DNS entry for domain validation. Replace `example.com` with your root doamin
2020-02-12 16:18:43 +00:00
```
sudo certbot certonly --manual -d *.example.com --agree-tos --no-bootstrap --manual-public-ip-logging-ok --preferred-challenges dns
2020-02-12 16:18:43 +00:00
```
## Configure DNS and Firewall
2020-06-23 08:13:59 +00:00
You will need to add DNS entries so that the three subdomains resolve to the IP of the docker host. There is a reverse proxy running that will route the hostnames to the correct container. On the host, you will need to ensure the firewall is open on tcp ports 80, 443, 4505, 4506.
2020-02-12 16:18:43 +00:00
## Run the environment with Docker
2020-11-20 00:03:44 +00:00
Get the docker-compose and .env.example file on the host you which to install on
2020-02-12 16:18:43 +00:00
2020-02-12 18:48:05 +00:00
```
2020-11-20 00:03:44 +00:00
wget https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/docker/docker-compose.yml
wget https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/docker/.env.example
mv .env.example .env
2020-02-12 16:18:43 +00:00
```
2020-11-20 00:03:44 +00:00
Change the values in .env to match your environment.
2020-02-12 16:18:43 +00:00
2020-11-20 00:03:44 +00:00
If you are supplying certificates through Let's Encrypt or another source, see the section below about base64 encoding the certificate files.
2020-11-20 00:03:44 +00:00
Then run the below command to start the environment.
2020-02-12 16:18:43 +00:00
2020-02-12 18:48:05 +00:00
```
2020-11-20 00:03:44 +00:00
sudo docker-compose up -d
2020-02-12 16:18:43 +00:00
```
2020-11-20 00:03:44 +00:00
## Get MeshCentral EXE download link
2020-11-20 00:03:44 +00:00
Run the below command to get the download link for the mesh central exe. This needs to be uploaded on first successful signin.
```
2020-11-20 00:03:44 +00:00
sudo docker-compose exec tactical-backend python manage.py get_mesh_exe_url
```
2020-11-20 00:03:44 +00:00
## Base64 encoding certificates to pass as env variables
2020-04-06 18:21:52 +00:00
2020-11-20 00:03:44 +00:00
Use the below command to add the the correct values to the .env.
2020-04-06 18:21:52 +00:00
2020-11-20 00:03:44 +00:00
Running this command multiple times will add redundant entries, so those will need to be removed.
2020-04-16 14:56:52 +00:00
2020-11-20 00:03:44 +00:00
Let's encrypt certs are stored in:
2020-04-16 14:56:52 +00:00
2020-11-20 00:03:44 +00:00
public key
`/etc/letsencrypt/live/${rootdomain}/fullchain.pem`
2020-11-20 00:03:44 +00:00
private key
`/etc/letsencrypt/live${rootdomain}/privkey.pem`
2020-05-07 03:42:42 +00:00
2020-11-20 00:03:44 +00:00
```
echo "CERT_PUB_KEY=$(sudo base64 -w 0 /path/to/pub/key)" >> .env
echo "CERT_PRIV_KEY=$(sudo base64 -w 0 /path/to/priv/key)" >> .env
2020-11-20 00:03:44 +00:00
```