Skip to content

Repo for deploying an OpenConnect VPN server via docker and docker-compose

License

Notifications You must be signed in to change notification settings

r4ven-me/openconnect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo is a part of the complete instruction on r4ven.me for deploying an OpenConnect VPN server via docker and docker-compose. All source files of server and client available at a src dir of this repo.

Project scheme

When using a domain to obtain SSL certificates, uncomment the certbot service and the depends_on parameter for the openconnect service, and specify your values instead of example in the docker-compose.yml file.

Installation and configuration of the OpenConnect VPN server

  1. Begin by creating a project directory
mkdir /opt/openconnect && cd /opt/openconnect
  1. Copying the docker-compose.yml file
curl -O https://raw.githubusercontent.com/r4ven-me/openconnect/main/openconnect/docker-compose.yml
  1. Launching the OpenConnect server
docker compose up -d && docker compose logs -f
  1. Creating a user with the ID "exampleuser" and the name "Example User" The .p12 certificate file will be created in ./data/secrets
docker exec -it openconnect ocuser exampleuser 'Example User'

Example of connecting the client using the openconnect utility

You can also use my bash script for automatic connect to ocserv via openconnect client utiliy

  1. Without a domain
sudo openconnect -c /home/exampleuser/exampleuser.p12 12.345.67.89:43443 <<< $(echo "examplepassword"$'\n'yes$'\n')
  1. With a domain
sudo openconnect -c /home/exampleuser/exampleuser.p12 example.com:43443 <<< $(echo "examplepassword"$'\n')

About

Repo for deploying an OpenConnect VPN server via docker and docker-compose

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published