How to setup SoftEther VPN server on Ubuntu into Google Cloud Platform

VPN doesn’t need much intro in this age but a basic definition is:

A virtual private network (VPN) extends a private network across a public network, and enables users to send and receive data across shared or public networks as if their computing devices were directly connected to the private network.

Meaning you can browse privately without prying eyes on connected public/private network. Or by pass GEO restrictions.

In this tutorial, we will be using Google Cloud Platform (GCP) trial account to setup up a VM (Virtual Machine) that will contain our VPN server. You can sign up for a trial account or use any existing subscription.


Once you have signed up for a new account, head over to Console -> Compute Engine and select “CREATE INSTANCE”.
We will be using following settings:
Name: ubuntu-openvpn

Zone: [Choose the closest one to you to get better latency and speed] – GCP Regions and Zone 

Machine Type: micro (1 Shared vCPU) – f1-Micro

Boot Disk: Ubuntu 16.04 LTS. Make sure to choose SSD Disk  not Standard Persistent.

Firewall: Check both checkboxes to allow http and https. We will be using 443 port for accessing our VPN server and thus HTTPS checkbox is marked.

Complete Settings:

You can go for a higher instance in terms of CPU and Memory but micro-f1 instance should be enough for few users. and 10 GB size is more than sufficient.  Click create and let it build.


Secure a static IP

We will need to assign a static IP otherwise, a new dynamic IP will be assigned each time vm is restarted.

Go to VPN Network -> External IP Address

and Change IP type from Ephemeral to Static for the VM we created. Give it a name.





SSH into the newly created VM using SSH button on Instance details page.

SSH into VM


Update/Upgrade VM

sudo apt-get update && sudo apt-get upgrade


Download SoftEther Vpn Server:

You can download the latest stable version from here. For this tutorial we will be using “v4.25-9656-rtm-2018.01.15-tree”. Run the following command to download directly into vm.


Extract the files:

sudo tar xvzf softether-vpnserver-v4.25-9656-rtm-2018.01.15-linux-x64-64bit.tar.gz

Install required libraries to build SoftEther vpnserver from source:

sudo apt-get install build-essential -y

Go to extracted Directory “vpnserver” and build

cd vpnserver && sudo make

Press 1 for all prompts:

If you don’t see any error, it’s been compiled successfully and we are ready to configure it.

Let’s move it to more meaning full directory: /usr/local by running following commands –

cd ..
sudo mv vpnserver /usr/local

Go to that directory:

cd /usr/local/vpnserver

Now we need to setup proper permissions for it to be executed.  Run following:

sudo chmod 600 *
sudo chmod 700 vpnserver
sudo chmod 700 vpncmd

Configure it to run at Start Up:

sudo vi /etc/init.d/vpnserver

Past the following and Save:

# chkconfig: 2345 99 01
# description: SoftEther VPN Server
test -x $DAEMON || exit 0
case "$1" in
$DAEMON start
touch $LOCK
$DAEMON stop
rm $LOCK
$DAEMON stop
sleep 3
$DAEMON start
echo "Usage: $0 {start|stop|restart}"
exit 1
exit 0

Change permission for Start Up file:

sudo chmod 755 /etc/init.d/vpnserver

Start the server:

sudo /etc/init.d/vpnserver start

Make it run at startup

sudo update-rc.d vpnserver defaults

Check if everything is OK

cd /usr/local/vpnserver
sudo ./vpncmd

Press 3 and type check


If all test pass, we are good to go:

Press exit to leave.


Run below command if you are out of VPN Tool

sudo ./vpncmd

Press 1 to enter into “Management of VPN Server or VPN Bridge“. Keep pressing enter for next two prompts without giving any input values.

Set Admin Password:


Create a Virtual Hub named “VPN” and provide a password for the hub.

HubCreate VPN

Select the new Hub


Enable SecureNat


Create a User

UserCreate johndoe

Set Password

UserPasswordSet johndoe

Enable L2TP/IPSec


Use following configuration:

Generate Certificate:

ServerCertRegenerate [CN]
ServerCertGet ~/cert.cer

Enable SSTP function

SstpEnable yes

Enable OpenVPN

OpenVpnEnable yes /PORTS:443

Copy OpenVPN Client configuration to a Zip File:

OpenVpnMakeConfig ~/

It’s now saved in user’s Directory.

You can use FTP to download  the config and use with OpenVPN Connect to connect to vpn server.



Leave a Reply

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