By Crafty-Codes
I have a Wireguard VPN on my droplet and want to open ports for my email server which is connected via VPN. As i have seen the firewall only supports opening ports for specific IP’s from the outside? So is it possible or should i route it? I already tried it to route with nginx with this but it did not work
# nginx wireguard config
server {
listen 51820;
location / {
proxy_pass http://wireguard:51820;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
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!
Heya @craftycodes,
In order to open a port there is something that needs to listen to it. Opening a port essentially means allowing network traffic to flow in and out of a specific communication endpoint on a Droplet. However, for that port to be useful, there needs to be a program or service on the computer that is actively listening to that port.
Think of a port as a door, and the service as the thing behind the door. Opening the door (port) doesn’t do much if there’s nothing on the other side to interact with. When a service is set to listen on a specific port, it means that it’s waiting for incoming connections or data on that port.
Anyway, in order open a port on your Droplet you need to use your firewall service, I would asume UFW.
First check the status
sudo ufw status
Then you can allow a port like so
sudo ufw allow 22/tcp
Where 22 is your port and tcp is the time of connection.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.