Skip to content

Docker container with OpenVPN client preconfigured for SurfShark

License

Notifications You must be signed in to change notification settings

lucanello/docker-surfshark

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-surfshark

Docker container with OpenVPN client preconfigured for SurfShark

Build only image


logo

This is a multi-arch image, updated automatically thanks to GitHub Actions.

Its purpose is to provide the SurfShark VPN to all your containers.

The link is established using the OpenVPN client.

Configuration

The container is configurable using 4 environment variables:

Name Mandatory Description
SURFSHARK_USER Yes Username provided by SurfShark
SURFSHARK_PASSWORD Yes Password provided by SurfShark
SURFSHARK_COUNTRY No The country, supported by SurfShark, in which you want to connect
CONNECTION_TYPE No The connection type that you want to use: tcp, udp

SURFSHARK_USER and SURFSHARK_PASSWORD are provided at the bottom of this page: https://account.surfshark.com/setup/manual.

SurfShark credentials

Execution

You can run this image using Docker compose and the sample file provided.

version: "2"

services: 
    surfshark:
        image: ilteoood/docker-surfshark
        container_name: surfshark
        environment: 
            - SURFSHARK_USER=YOUR_SURFSHARK_USER
            - SURFSHARK_PASSWORD=YOUR_SURFSHARK_PASSWORD
            - SURFSHARK_COUNTRY=it
            - CONNECTION_TYPE=udp
        cap_add: 
            - NET_ADMIN
        devices:
            - /dev/net/tun
        restart: unless-stopped

Or you can use the standard docker run command.

sudo docker run -it --cap-add=NET_ADMIN --device /dev/net/tun --name CONTAINER_NAME -e SURFSHARK_USER=YOUR_SURFSHARK_USER -e SURFSHARK_PASSWORD=YOUR_SURFSHARK_PASSWORD ilteoood:docker-surfshark

If you want to attach a container to the VPN, you can simply run:

sudo docker run -it --net=container:CONTAINER_NAME alpine /bin/sh

If you face network connection problems, I suggest you to set a specific DNS server for each container.

About

Docker container with OpenVPN client preconfigured for SurfShark

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dockerfile 57.1%
  • Shell 42.9%