OpenVPN server on Debian

1. Software installation

Install OpenVPN and Easy-RSA :

2. Configuration

Copy the sample configuration file :


And edit it :

Here is my configuration :

3. Diffie-Helman certificate

Generate the Diffie-Helman certificate:

4. Keys and certificates generation

4.1 Preparation

Copy the Easy-RSA generation scripts in the OpenVPN folder :

Create a folder for the generated keys :

Edit the variable file :

And adjust the following ones :

Move to the Easy-RSA folder in order to generate the keys :

Initialize the PKI :

The output should looks like this :

You might have the following issue :

In this case, just create a symbolic link :

And then clean everything :

4.2 Server certificate

Build the CA :

You might have the following error :

In this case, just create a symbolic link :

And try again to build the certificate.

4.3 Server private key

Generate server key :

5. Files copy

Create a folder for the generated keys in the OpenVPN folder :

And copy the generated files in this folder :

6. Start OpenVPN

We can now start the service :

You can check that everything is fine by checking the logs :

You should have something close to :

7. Add new clients

7.1 Generate a new key

Let’s move in the right folder to generate a new key for our client :

And generate a new key :

You’re ready to connect your first client !

One thought on “OpenVPN server on Debian”

Leave a Reply

Your email address will not be published. Required fields are marked *