How to connect a Droplet to VPN?

I have a Django application running on a droplet that collects data from several IoT devices on customer sites. These IoT devices are currently openly accessed but will soon be put behind a VPN. How do I connect my droplet to an external VPN to still be able to access the data?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Site Moderator
Site Moderator badge
January 22, 2023

Hello @m4rkus

As Bobby mentioned you’ll need a VPN client in order to connect to the network. The openvpn client should do the job for you, but this may vary from the VPN configuration on the remote server as well.


Bobby Iliev
Site Moderator
Site Moderator badge
January 21, 2023

Hi there,

I believe that this might depend on the VPN setup on the customer side, but what you might be able to do is to use a VPN client to connect the server to the external VPN service.

Depending on the VPN server, you could use the OpenVPN client to do that.

If you are using Ubuntu, you can install OpenVPN using this command: sudo apt install openvpn. Once you’ve installed the package, can create a config file using your favourite text editor: sudo nano /etc/openvpn/client.conf, in there add the configuration file (opvn) from your customer’s VPN service. Save the config file and then start the OpenVPN client: sudo openvpn --config /etc/openvpn/client.conf.

Hope that this helps!



Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel