How to turn on TUN/TAP on droplet server

to run openvpn I need tun/tap, how to start it ?

Already running

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
July 5, 2024


I assume this is now sorted, I’ll like to mention the following. Run the following command to see if the TUN device is available:

cat /dev/net/tun

If it returns File descriptor in bad state, it means the TUN/TAP driver is available.

Additionally, once OpenVPN is running, verify the TUN interface is up:

ip a show tun0

You should see an interface named tun0 with an IP address assigned.


Site Moderator
Site Moderator badge
July 2, 2024


In case you still need to enable tun/tap,

1. Check if TUN/TAP is Enabled

First, check if the TUN/TAP module is already enabled:

cat /dev/net/tun

If you see the output “File descriptor in bad state”, it means TUN/TAP is enabled. If you see “No such file or directory”, it means TUN/TAP is not enabled.

2. Load the TUN Module

If TUN/TAP is not enabled, you need to load the TUN module:

sudo modprobe tun

You can verify that the module is loaded:

lsmod | grep tun

You should see an output like:

tun 28672 0

3. Ensure TUN/TAP Loads on Boot

To ensure that the TUN module loads on boot, you need to add it to /etc/modules:

echo "tun" | sudo tee -a /etc/modules
Bobby Iliev
Site Moderator
Site Moderator badge
July 2, 2024

Hi there,

Noticed that you mentioned that this is already running? Did you sort it out and if so would you mind sharing this with the community here?

What I personally do when setting up an OpenVPN instance is to use the 1-Click installation from the DigitalOcean Marketplace:

- Bobby

Try DigitalOcean for free

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

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

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

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

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