openjanus
Stack combining OpenResty, automatic SSL (registration & renewal), and a built-in WireGuard VPN.
1.5K
An open-source, containerized infrastructure stack combining OpenResty, automatic SSL (registration & renewal), and a built-in WireGuard VPN to securely expose public and private endpoints with minimal configuration and operational overhead.
If you find this project helpful, consider supporting my work.
| OpenJanus Version | OpenResty Version | WireGuard | Certbot |
|---|---|---|---|
| 1.0.0-alpine | 1.27.1.2-alpine | 1.0.20250521 | 4.0.0 |
services:
openjanus:
image: prabhjeetme/openjanus:latest
container_name: openjanus
restart: always
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun:/dev/net/tun
environment:
- CB_TESTING=0
- [email protected]
- CB_DOMAINs=example.com app1.example.com
- WG_PEERS=phone:10.13.13.2,tablet:10.13.13.3
- VPN_ENDPOINT=vpn.example.com
- VPN_PORT=51820
- SERVER_PUBLIC_IP=xx.xx.xx.xx
ports:
- "80:80"
- "443:443"
- "51820:51820/udp"
volumes:
- ./configs/conf:/etc/openjanus/conf:ro # Nginx config
- ./configs/stream:/etc/openjanus/stream:ro # Nginx steam config
- ./volumes/letsencrypt:/etc/letsencrypt # SSL certificates
- ./volumes/openjanus/ssl:/etc/openjanus/ssl # Stores DH param
- ./volumes/openjanus/var:/var/lib/openjanus # Stores run state
- ./volumes/wireguard:/etc/wireguard # VPN configs
| Variable Name | Required | Default | Description |
|---|---|---|---|
| VERSION | False | [OpenJanus version] | OpenJanus version. |
| CB_EMAIL | True | Email required by certbot for account registration and for contacting in case of any issue. | |
| CB_DOMAINs | True | Space separated CB_DOMAINs that are needed to be registered (No wildcards) | |
| CB_CRON_PATTERN | False | 0 0 * * * | Certbot renewal cronjob to renew due certificates. |
| CB_TESTING | False | 0 | Provide 1 (instead of 0) for test mode. Sets --staging (in case of domain challenge) & --dry-run (in case of renew). |
| SERVER_PUBLIC_IP | True | blank | Server's public IP where container is container is deployed. |
| VPN_ENDPOINT | True | blank | VPN Endpoint. |
| VPN_PORT | False | 51820 | 51820 default WireGuard port. Change if a different port is mapped on host. |
| SSL_DH_SIZE | False | 2048 | DH param size. File is generated on first run |
| Container Path | Type | Description | Example |
|---|---|---|---|
| /etc/openjanus/conf | ro | Nginx configurations (files containing server blocks) | Reverse proxy configuration |
| /etc/openjanus/stream | ro | Nginx configurations (files containing server blocks) | Stream TCP connection to your application |
| /etc/letsencrypt | rw | Stores SSL certificates | Your domain's SSL certificates |
| /etc/openjanus/ssl | rw | Stores DH param file | - |
| /var/lib/openjanus | rw | Stores OpenJanus run state (to detect first run) | .first_run_done |
| /etc/wireguard | rw | Stores VPN configuration | Peers etc |
| Host | Container | Description |
|---|---|---|
| 80 | 80 | HTTP port |
| 443 | 443 | HTTPs port |
| 51820 | 51820/udp | WireGuard Port |
docker compose up -d.For more information visit OpenJanus Repository on GitHub.
Content type
Image
Digest
sha256:5afdfae0a…
Size
86.7 MB
Last updated
4 months ago
docker pull prabhjeetme/openjanus