expressvpn
Dockerized version of ExpressVPN exposing API and a minimalistic UI to interact with it.
8.0K
https://github.com/superdanio/expressvpn
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/preferences | Returns the preferences currently in use |
| GET | /api/servers | Returns the list of servers you can connect to |
| GET | /api/status | Returns the current status of the connection |
| GET | /api/test?url=<string> | Redirects to the given url. Useful for testing connectivity |
| GET | _/api/version | Returns the expressvpn client version |
| POST | /api/connect/<string:server> | Connects to the given server or to 'smart' if blank |
| POST | /api/disconnect | Disconnects from current server |
| POST | /api/preferences/<string:name>/<string:value> | Sets the given preference |
| POST | /api/refresh | Refreshes the current VPN cluster |
A very minimalistic UI is exposed on the main port. Nothing fancy, just plain html and javascript to keep it simple.
docker run -it --privileged --cap-add=NET_ADMIN --device=/dev/net/tun -p 25000:5000 -e ACTIVATION_CODE=<YOUR_CODE> -e CONNECT_AT_STARTUP=true expressvpn:local
services:
expressvpn:
container_name: expressvpn
image: superdanio/expressvpn
environment:
- ACTIVATION_CODE={% your-activation-code %}
- SERVER={% LOCATION/ALIAS/COUNTRY %} # optional
- PREFERRED_PROTOCOL={% protocol %} # optional
- LIGHTWAY_CIPHER={% lightway-cipher %} # optional
- CONNECT_AT_STARTUP={% true | false %}
- HEALTHCHECK_TARGET={% url %} # optional
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun
stdin_open: true
tty: true
privileged: true
restart: unless-stopped
volumes:
- /tmp/vpn:/vpn_shared
ports:
- "5000:5000" # exposing API port
# ports of other containers that use the vpn (to access them locally)
curl:
image: alpine/curl
container_name: curl
command: sleep infinity
network_mode: service:expressvpn
depends_on:
expressvpn:
condition: service_healthy
volumes:
- /tmp/vpn/resolv.conf:/etc/resolv.conf
You can test it by executing:
docker compose exec -it curl curl ifconfig.me
A mandatory string containing your ExpressVPN activation code.
ACTIVATION_CODE=ABCD1EFGH2IJKL3MNOP4QRS
An optional string containing the ExpressVPN server LOCATION/ALIAS/COUNTRY. Connect to smart location if it is not set.
SERVER=smart
An optional string containing the ExpressVPN protocol. Can be auto, udp, tcp ,lightway_udp, lightway_tcp. Use auto if it is not set.
PREFERRED_PROTOCOL=lightway_udp
An optional string containing the ExpressVPN lightway cipher. Can be auto, aes, chacha20. Use auto if it is not set.
LIGHTWAY_CIPHER=chacha20
An optional string (representing a boolean) to determine whether it should connect to a server at startup.
An optional string representing the url to hit for healthcheck. Default: http://ifconfig.me
If the schema is not provided, the url will be resolved as internal to the api: i.e. status => http://localhost:5000/api/status
Content type
Image
Digest
sha256:32d012abc…
Size
82.2 MB
Last updated
over 1 year ago
docker pull superdanio/expressvpn