This is the hardest deployment I’ve ever done. I wouldn’t have been able to deploy this without [Guru Computing’s Blog](https://blog.gurucomputing.com.au/Knowledgebases%20with%20Outline/Installing%20Outline%20Knowledgebase/)! I do not advise deploying this unless you’ve had some experience with deploying any of the other apps in this repostitory. If you get stuck here please refer to Guru’s Computing’s blog!
## Minimum File Structure
```
/home/
└── ~/
└── docker/
└── outline/
├── .env
├── docker-compose.yml
├── docker.env
└── keycloak/
├── .env
├── docker-compose.yml
```
## Add to Caddyfile (from \~/docker/caddy)
Remember to `docker exec -w /etc/caddy caddy caddy reload` after editing your Caddyfile.
```
outline.yourdomain.com {
reverse_proxy outline:3000
}
outlinedata.yourdomain.com {
reverse_proxy outline-minio:9000
}
outlinedata-admin.yourdomain.com {
reverse_proxy outline-minio:9001
}
auth.yourdomain.com {
reverse_proxy keycloak:8080
}
```
outline-minio is the s3 bucket we’ll be using.
keycloak is the auth provider we will be self hosting
# The “keycloak” directory
We will start with keycloak for single sign on first because it is easier and we need to get the client secret from it for outline! Start by creating a empty keycloak directory similar to the minimum file structure section above.
## docker-compose.yml
Copy and use the same docker-compose.yml in this repo’s ./keycloak directory
### Optional: Set up SMTP variables to receive emails from outline
```javascript
SMTP_HOST=
SMTP_PORT=
SMTP_USERNAME=
SMTP_PASSWORD=
SMTP_FROM_EMAIL=hello@example.com
SMTP_REPLY_EMAIL=hello@example.com
SMTP_TLS_CIPHERS=
SMTP_SECURE=true
```
## .env modifications needed
The three variables `MINIO_ROOT_PASSWORD`, `MINIO_BROWSER_REDIRECT_URL`, and `POSTGRES_PW` need to be replaced similarly to docker.env. Use the same minio password `<insert long and scary minio password>` and PG `<insert long and scary PG password>` password as above. As for the URL replace `yourdomain.com` with your actual domain you will be hosting this on.
## Logging into your minio bucket and creating outlinebucket
This step needs to be done so you can drag / drop upload files to your outline pages
In your browser go to `https://outlinedata-admin.yourdomain.com` and login
Finally create a bucket called `outlinebucket`
After creation, under the anonymous tab add two access rules: `avatar` and `public` as readonly access rules. Don’t worry if you’re confused here’s a gif below explaining all this.