Tailscale
This guide outlines the process of integrating your OpenRelik server with Tailscale, allowing secure access to your server from anywhere on your Tailscale network.
Reference: Official Tailscale guide for using Tailscale with Docker: https://tailscale.com/kb/1282/docker
Prerequisites:
- An installed and functioning OpenRelik server.
- A Tailscale account with administrative privileges.
Steps:
-
Install OpenRelik: Follow the standard OpenRelik installation instructions to set up your server. Installation instructions
-
Obtain your Tailscale Name: Identify your Tailscale network name, which usually follows the format
yourname.ts.net. -
Generate a Tailscale AuthKey:
- Log in to your Tailscale admin console at https://tailscale.com.
- Navigate to Settings -> Personal settings -> Keys
- Click “Generate auth key…”
- Provide a descriptive name for your key (e.g., “OpenRelik”)
- Enable the “Reusable” option to use the same key for both API and UI servers
- Copy the generated key for later use
-
Create Configuration Directories: In your OpenRelik directory, create the following directories:
Terminal window tailscale-nginx-api/configtailscale-nginx-ui/config -
Configure Tailscale for OpenRelik API: Create the file
tailscale-nginx-api/config/openrelik-api.jsonwith the following content:{"TCP": {"443": {"HTTPS": true}},"Web": {"openrelik-api.yourname.ts.net:443": {"Handlers": {"/": {"Proxy": "http://127.0.0.1:8710"}}}}}Important: Replace
yourname.ts.netwith your actual Tailscale network name. -
Configure Tailscale for OpenRelik UI: Create the file
tailscale-nginx-ui/config/openrelik-ui.jsonwith the following content:{"TCP": {"443": {"HTTPS": true}},"Web": {"openrelik.yourname.ts.net:443": {"Handlers": {"/": {"Proxy": "http://127.0.0.1:8711"}}}}}Important: Replace
yourname.ts.netwith your actual Tailscale network name. -
Update docker-compose.yml: Add the following services to your
docker-compose.ymlfile:tailscale-nginx-ui:container_name: openrelik-tailscale-nginx-uiimage: tailscale/tailscale:latesthostname: openrelikenvironment:- TS_AUTHKEY=<AUTHKEY>- TS_SERVE_CONFIG=/config/openrelik-ui.json- TS_STATE_DIR=/var/lib/tailscalevolumes:- ${PWD}/tailscale-nginx-ui/state:/var/lib/tailscale- ${PWD}/tailscale-nginx-ui/config:/config- /dev/net/tun:/dev/net/tuncap_add:- net_admin- sys_moduletailscale-nginx-api:container_name: openrelik-tailscale-nginx-apiimage: tailscale/tailscale:latesthostname: openrelik-apienvironment:- TS_AUTHKEY=<AUTHKEY>- TS_SERVE_CONFIG=/config/openrelik-api.json- TS_STATE_DIR=/var/lib/tailscalevolumes:- ${PWD}/tailscale-nginx-api/state:/var/lib/tailscale- ${PWD}/tailscale-nginx-api/config:/config- /dev/net/tun:/dev/net/tuncap_add:- net_admin- sys_moduleImportant: Replace
<AUTHLEY>with your AuthKey that you created in step 3. -
Modify Existing Services in docker-compose.yml: Adjust the
openrelik-serverandopenrelik-uiservices in yourdocker-compose.ymlfile as follows:openrelik-server:# ... (existing configuration) ...depends_on:- tailscale-nginx-apinetwork_mode: service:tailscale-nginx-apicommand: uvicorn main:app --proxy-headers --forwarded-allow-ips '*' --workers 1 --host 0.0.0.0 --port 8710openrelik-ui:# ... (existing configuration) ...depends_on:- tailscale-nginx-uinetwork_mode: service:tailscale-nginx-ui -
Update config.env: In your OpenRelik directory, modify the
config.envfile:OPENRELIK_SERVER_URL=https://openrelik-api.yourname.ts.netImportant: Replace
yourname.ts.netwith your actual Tailscale network name. -
Update settings.toml: In your OpenRelik directory, modify the
config/settings.tomlfile:# ... (existing configuration) ...api_server_url = "https://openrelik-api.yourname.ts.net"ui_server_url = "https://openrelik.yourname.ts.net"allowed_origins = ["https://openrelik.yourname.ts.net"]Important: Replace
yourname.ts.netwith your actual Tailscale network name. -
Restart OpenRelik: Restart your OpenRelik server using
docker-compose up -dto apply the changes.
Your OpenRelik server should now be accessible via your Tailscale network at the URLs you configured. You can access the UI by navigating to https://openrelik.yourname.ts.net from any device connected to your Tailscale network.