Skip to content

Lokal Server Installation

Lokal server require you to run docker compose with network_mode: "host" enabled, this feature allow lokal to bind tcp or udp port without manually defining the ports before running

Create a new file named docker-compose.yml and paste the following content:

docker-compose.yml
services:
lokal-server:
network_mode: "host"
image: citatoji/lokal-server:latest
restart: unless-stopped
environment:
- TUNNEL_SERVER_BIND_HOST=${TUNNEL_SERVER_BIND_HOST}
- TUNNEL_SERVER_BIND_PORT=${TUNNEL_SERVER_BIND_PORT}
- TUNNEL_SERVER_JWT_SECRET=${TUNNEL_SERVER_JWT_SECRET}
- TUNNEL_SERVER_ENCRYPTION_KEY=${TUNNEL_SERVER_ENCRYPTION_KEY}
- VHOST_HTTP_HOST=${VHOST_HTTP_HOST}
- VHOST_HTTP_PORT=${VHOST_HTTP_PORT}
watchtower:
image: containrrr/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --interval 60 --cleanup --include-stopped --cleanup --revive-stopped
restart: unless-stopped

Create a new file named lokal.env and paste the following content:

lokal.env
TUNNEL_SERVER_BIND_HOST="0.0.0.0"
TUNNEL_SERVER_BIND_PORT="26515"
TUNNEL_SERVER_JWT_SECRET="CHANGE_ME"
TUNNEL_SERVER_ENCRYPTION_KEY="CHANGE_ME"
VHOST_HTTP_HOST="0.0.0.0"
VHOST_HTTP_PORT="80"

Start Lokal Tunnel Server

Terminal window
docker compose --env-file lokal.env up -d