Coder Social home page Coder Social logo

pivpn-docker's Introduction

PiVPN in Docker Container

Setting up an VPN server is easy, but we can make it even easier and you can do it within 1 min. All the prerequisite is just the docker which has been compatible with the Raspberry Pi for a while. If you don't have the docker installed on your little machine, go and check it out here.

Build

Build Status

Docker Images

Supported Architectures

  • x86_64/amd64
  • armv7hf (Raspberry Pi 2 and 3)

Usage

  1. Launch PiVPN on a machine, which would be the PiVPN server.

    docker run -ti --rm \
         --privileged \
         -p 443:443/udp \
         -v "$HOME"/ovpns:/home/pivpn/ovpns \
         ljishen/pivpn

    Wait until you see PiVPN Service Started

  2. Copy the client ovpn profile under "$HOME"/ovpns to the machine/device from where you want to connect to the PiVPN server. The name of the client profile is client.ovpn by default.

  3. Install the OpenVPN application on the client. On Debian OS, it would be as easy as

    sudo apt-get install openvpn

    Then you can start the VPN client using

    sudo openvpn --auth-nocache --config client.ovpn

    The default Private Key Password is vpnpasswd and you can change it in the configuration file setupVars.conf.

  4. In case you have any connection problems, try to modify the variables in file setupVars.conf before restarting the PiVPN server using the same command from step 1. You can also create an issue and let me know if I can help you.

Credit

Miscellaneous

Commands to Create the Docker Image Manifest

docker manifest create ljishen/pivpn ljishen/pivpn:amd64 ljishen/pivpn:armv7hf
docker manifest annotate ljishen/pivpn ljishen/pivpn:armv7hf --os linux --arch arm --variant v7
docker manifest annotate ljishen/pivpn ljishen/pivpn:amd64 --os linux --arch amd64

# purge the local manifest after push so that I can
# upgrade the manifest by creating a new one next time.
# https://github.com/docker/for-win/issues/1770
docker manifest push --purge ljishen/pivpn

pivpn-docker's People

Contributors

ljishen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pivpn-docker's Issues

Image reinstall PiVPN with each restart

It seems every container restart reinstalls the PiVPN software ... That seems a bit too much, especially during reboots of a machine. The container should be persistant, the image not ofcourse.

easy-rsa not found

Hello,

I'm getting an error when I try to run a new container.

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
chown: cannot access '/etc/openvpn/easy-rsa': No such file or directory

After debugging a little bit, I noticed that it tries to get the following link, that is not available now.

https://github.com/pivpn/easy-rsa/releases/download/3.0.1-pivpn1/EasyRSA-3.0.1-pivpn1.tgz

vagrant@ubuntu-bionic:~$ wget https://github.com/pivpn/easy-rsa/releases/download/3.0.1-pivpn1/EasyRSA-3.0.1-pivpn1.tgz
--2020-04-12 19:21:10--  https://github.com/pivpn/easy-rsa/releases/download/3.0.1-pivpn1/EasyRSA-3.0.1-pivpn1.tgz
Resolving github.com (github.com)... 140.82.112.3
Connecting to github.com (github.com)|140.82.112.3|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2020-04-12 19:21:11 ERROR 404: Not Found.

vagrant@ubuntu-bionic:~$

re-starting container deletes all keys and certs

i start the container and everything works. client can connect.

stop the container and start it again.
directly after the start the folder /etc/openvpn/easy-rsa is deleted.
while all the keys and certificates are in there.
mounting the folder /etc/openvpn outside the container in a volume does not help.

i don't want to wait 40 mins every start nor copy the client.ovpn file to the client every start of the container

rpi4 support

Hi,

Anyway that this could be adapted to run on rpi4 arm64??

Thanks

Updating the setupVars.conf file

I'm running a container of this image on LibreELEC with the following command:

docker run --rm --privileged -p 443:443/udp --name=pivpn -v /storage/ovpns:/home/pivpn/ovpns ljishen/pivpn

I would like to set a different port and password, but I don't know how to edit the setupVars.conf file, as mentioned in the README.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.