Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Use Gluetun as the VPN gateway container, then place each application that must use the tunnel in Gluetun’s network namespace. The essential Compose settings are NET_ADMIN, /dev/net/tun, VPN_TYPE=openvpn, your provider’s Gluetun identifier, and that provider’s OpenVPN credentials. Publish application ports on Gluetun, not on the routed application.

This design gives dependent containers the same outbound route and Gluetun’s firewall protection. If the VPN connection disappears, the firewall blocks their traffic instead of allowing a direct connection.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the Gluetun arrangement does

Gluetun is a VPN gateway container. It creates the OpenVPN tunnel, applies the VPN provider’s routing and DNS settings, and enforces a firewall inside its container. An application connected with network_mode: "service:gluetun" does not get an independent network namespace; it uses Gluetun’s namespace, interfaces, routes and firewall.

That shared namespace is the reason the setup protects more than Gluetun itself. The project’s Compose guide explains that when a child container shares Gluetun’s network, the kill switch protects the child too: if the VPN drops, the child’s traffic stops. The firewall permits the traffic needed to establish and maintain the VPN, while LAN or inbound traffic must be explicitly allowed when you need it.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.

There are two port concepts to keep separate:

  • Docker port publishing: a host-to-container mapping such as 8080:8080. Because the application shares Gluetun’s namespace, this mapping belongs on the Gluetun service.
  • VPN server-side port forwarding: a port opened by the VPN provider on its remote server. This is optional and is unrelated to Docker’s ports: setting.

Before you create the stack

Provider account and OpenVPN access

You need a VPN subscription that supports OpenVPN credentials and a provider configuration supported by Gluetun. The provider name used in VPN_SERVICE_PROVIDER is Gluetun’s identifier, not necessarily the marketing name shown in the provider’s desktop application. Obtain the current identifier and any required server, country, city, region, certificate or authentication variables from that provider’s Gluetun instructions.

OpenVPN credentials are not interchangeable with every other VPN credential. Do not substitute a WireGuard private key, an API token, or credentials intended only for a desktop application unless the provider explicitly documents them for OpenVPN. Some providers issue separate service credentials for manual VPN connections.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Docker host requirements

  • A working Docker Engine installation with the Docker Compose plugin.
  • Permission for the Gluetun container to add network administration capabilities.
  • The host’s TUN device at /dev/net/tun. Most Linux hosts provide it; a restricted virtual machine, NAS, or containerized Docker host may require additional host configuration.
  • A host firewall that allows the published application ports you intend to use.
  • A private way to supply credentials, such as an uncommitted .env file or a secret-management system.

Use the exact Gluetun provider page for provider-specific requirements. The generic Compose pattern below intentionally leaves the provider identifier and application image as values you must replace.

Build a minimal OpenVPN Compose file

Create a directory for the stack and save this as compose.yml:

services:
  gluetun:
    image: qmcgaw/gluetun
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    ports:
      - "8080:8080"
    environment:
      - VPN_SERVICE_PROVIDER=your_provider
      - VPN_TYPE=openvpn
      - OPENVPN_USER=${OPENVPN_USER}
      - OPENVPN_PASSWORD=${OPENVPN_PASSWORD}

  app:
    image: your/app
    network_mode: "service:gluetun"
    depends_on:
      - gluetun

Replace your_provider with the identifier documented by your VPN provider and replace your/app with the application image. Change 8080:8080 to the application’s listening port and add additional mappings when the application exposes more than one port.

What each Gluetun setting means

Compose setting Purpose
image: qmcgaw/gluetun Runs the Gluetun VPN gateway.
cap_add: NET_ADMIN Allows the container to configure routes, interfaces and firewall rules required for the tunnel.
/dev/net/tun:/dev/net/tun Passes the host TUN device into the container so OpenVPN can create its tunnel interface.
VPN_SERVICE_PROVIDER Selects Gluetun’s provider-specific configuration.
VPN_TYPE=openvpn Selects OpenVPN rather than another supported tunnel type.
OPENVPN_USER and OPENVPN_PASSWORD Supply the OpenVPN account credentials required by the provider.
network_mode: "service:gluetun" Makes the application share Gluetun’s network namespace and VPN route.
depends_on: gluetun Expresses the Compose startup dependency on the gateway service.
ports on Gluetun Publishes the shared namespace’s listening ports on the Docker host.

Put credentials in an environment file

In the same directory, create .env:

OPENVPN_USER=the_openvpn_username
OPENVPN_PASSWORD=the_openvpn_password

Use the actual values issued for OpenVPN. Keep this file out of source control and restrict its permissions on multi-user hosts. Do not paste its contents into issue reports or shared logs. A deployment platform’s secret facility is preferable when one is available.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Compose substitutes the variables when it reads the file. To verify that the file and Compose syntax are valid, run docker compose config locally and inspect the result privately; its rendered output can contain your credentials. Never publish that output or include it in a support ticket without removing secrets.

Route an application through Gluetun

Add the application’s service to the same Compose project with network_mode: "service:gluetun" and depends_on: [gluetun]. Do not add a second ordinary Docker network to that service unless you understand the routing and leak consequences. A second network can provide a path that bypasses the VPN firewall.

For a service with several listeners, publish every required port under Gluetun. For example:

services:
  gluetun:
    image: qmcgaw/gluetun
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    ports:
      - "8080:8080"   # web interface
      - "51413:51413" # example TCP listener
      - "51413:51413/udp" # example UDP listener
    environment:
      - VPN_SERVICE_PROVIDER=your_provider
      - VPN_TYPE=openvpn
      - OPENVPN_USER=${OPENVPN_USER}
      - OPENVPN_PASSWORD=${OPENVPN_PASSWORD}

  app:
    image: your/app
    network_mode: "service:gluetun"
    depends_on:
      - gluetun

The comments identify the intent of the mappings; use the ports your application actually documents. The application still listens on its own internal port, but Docker sees that listener in Gluetun’s namespace. A ports: block on the application service is ineffective in this network mode because that service has no separate namespace for Docker to publish.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Application bind addresses

If the container is running but its web interface is unreachable, inspect the application’s bind-address setting. An interface-specific bind may prevent access through the published port. Where the application offers a choice, bind its listener to all interfaces in the shared namespace or to the interface documented for its container image. Make this change in the application’s own configuration, then restart the service.

Start the stack and verify the tunnel

  1. From the directory containing compose.yml and .env, run docker compose up -d.
  2. Check container state with docker compose ps.
  3. Read the gateway log with docker compose logs -f gluetun. Confirm that Gluetun selected the intended provider, entered OpenVPN mode, authenticated successfully and reached a healthy tunnel state.
  4. After the gateway is healthy, check the application log with docker compose logs app, replacing app with the service name.
  5. Test outbound IP and DNS from inside the routed application container using diagnostic tools available in that image. The observed public IP should be the VPN exit address, not the Docker host’s normal address.
  6. Open the application through the host address and the port published on Gluetun, such as http://host-address:8080.

Run the outbound test from the routed container, not only from Gluetun. The child shares the network namespace, but testing both services can reveal an application-specific startup or DNS issue.

Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Understand the firewall and kill-switch behavior

Gluetun’s firewall is enabled inside the gateway. It allows the traffic required to connect to the VPN and blocks traffic that would otherwise leave through the host’s ordinary route. The project FAQ describes this as effectively acting as a kill switch: when the VPN connection goes down, traffic is blocked.

Because the application uses Gluetun’s namespace, this protection applies to the application as well. A temporary loss of connectivity is therefore an expected safety behavior, not proof that Docker has crashed. Wait for Gluetun to restore the tunnel and inspect its logs before changing firewall settings.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

LAN access and inbound access are separate from ordinary outbound VPN traffic. If the application must reach a local database, NAS, printer or management network, follow Gluetun’s current firewall documentation for explicitly permitted LAN traffic. Avoid broad exemptions that create an unexamined path around the VPN policy.

OpenVPN provider settings that vary

The generic variables are only the common foundation. Providers can require additional selectors or certificates, and the available server controls differ. Depending on the provider, you may need to add a country, region, city, server hostname, protocol, certificate or account option. Add only variables listed on that provider’s current Gluetun page.

Do not infer a provider identifier from a similarly named desktop application. Gluetun uses its own documented identifiers. If the log reports an unknown provider, correct VPN_SERVICE_PROVIDER before troubleshooting credentials.

Authentication failures can have several causes:

  • The account uses ordinary website credentials while the provider requires separate manual-connection credentials.
  • The username or password contains a character that was copied incorrectly into .env.
  • The provider account has no OpenVPN access or has reached an account-device limit.
  • A required provider-specific certificate, server selector or region variable is missing.
  • The Compose file still contains a placeholder provider identifier.

Check the Gluetun log for the exact failure category, then compare every variable with the provider’s current instructions. Avoid repeatedly changing unrelated networking settings while authentication is still failing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Docker port publishing versus VPN port forwarding

Publishing 8080:8080 makes a host port reachable at the Docker host and forwards it into the shared Gluetun namespace. It does not ask the VPN provider to accept unsolicited traffic from the internet.

Server-side VPN forwarding is a provider feature. Gluetun’s advanced documentation states that native forwarding is implemented for Private Internet Access and ProtonVPN and can be enabled with:

VPN_PORT_FORWARDING=on

When a provider assigns a forwarded port externally, Gluetun documents FIREWALL_VPN_INPUT_PORTS for allowing that port through the VPN firewall. Add the assigned value according to the provider and Gluetun instructions, then configure the same current port in the application.

The port can change when the VPN session or server changes. An application configured with yesterday’s value may appear to have stopped accepting inbound connections even though the tunnel is healthy. For inbound problems, verify all of these points:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. The provider supports forwarding for the account, plan and selected server.
  2. The forwarding feature is enabled in Gluetun.
  3. The assigned port is allowed through the Gluetun VPN firewall.
  4. The application is listening on that port and is configured with the latest assigned value.
  5. Docker publishes the application listener on Gluetun when access from the local host or LAN is required.

Forwarding is not required for ordinary outbound browsing and many client applications. Enable it only when the application benefits from unsolicited inbound connections.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot in a fixed order

1. Validate Compose interpolation

Run docker compose config on the Docker host and inspect it privately. Confirm that VPN_TYPE is openvpn, the provider identifier is correct, and the credential variables are populated. Do not share the rendered file because it may contain secrets.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

2. Read Gluetun’s log before the application’s log

Use docker compose logs gluetun. Look for provider selection, OpenVPN startup, authentication, tunnel establishment and health. If the tunnel never becomes healthy, an application UI cannot work reliably yet.

3. Confirm the shared network mode

The routed service must contain the exact setting network_mode: "service:gluetun". A spelling error, a different service name, or an independent network attachment changes the routing behavior. Confirm that the service name after service: exactly matches the gateway service.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Check where ports are published

Every UI or listener needed from outside the application container must be listed under Gluetun’s ports:. Remove the expectation that a ports: block on the child service will publish it. Then verify that the host firewall permits the selected host port.

5. Check the application bind address

If the tunnel is healthy and Docker shows the port published, inspect the application’s listening address and port. A service bound only to an unexpected interface or port will not answer even when the Compose mapping is correct.

6. Test outbound traffic from the child

Run an IP and DNS check from inside the routed container with the diagnostic utilities available in that image. If outbound traffic fails while Gluetun is healthy, inspect the application’s proxy, DNS or startup configuration. If traffic works but the UI does not, focus on publishing, bind address and host firewall rules.

Inbound-only failures

When outbound access works but peers cannot connect, treat it as a forwarding problem rather than an OpenVPN login problem. Check provider support, the forwarding option, FIREWALL_VPN_INPUT_PORTS, the application’s current port and Docker’s host mapping. Remember that a VPN-assigned port can change after reconnection.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Operational and security practices

  • Keep the Gluetun image and provider instructions current, but review configuration changes before applying them to a production stack.
  • Store OpenVPN credentials outside version control and rotate them when the provider requires it.
  • Publish only the ports that need host or LAN access. Every published port increases the reachable surface of the Docker host.
  • Do not disable the firewall merely to make a temporary connectivity test. Read the gateway log and correct the route, credential or port configuration instead.
  • Record which application ports are published on Gluetun so future changes do not accidentally add a mapping to the child service.
  • When changing providers, update the identifier, authentication variables and all provider-specific server or certificate settings together.

A complete deployment checklist

  • The provider supports manual OpenVPN connections for your account.
  • VPN_SERVICE_PROVIDER contains the provider identifier documented for Gluetun.
  • VPN_TYPE=openvpn is present.
  • OPENVPN_USER and OPENVPN_PASSWORD contain the provider’s OpenVPN credentials.
  • NET_ADMIN is granted and /dev/net/tun is mapped.
  • The application uses network_mode: "service:gluetun".
  • The application depends on Gluetun and has no unintended independent network path.
  • All required application ports are published under Gluetun.
  • The host firewall permits the host-side ports you intentionally exposed.
  • Gluetun logs show a healthy OpenVPN tunnel before you judge the application.
  • Outbound IP and DNS are tested from the routed application container.
  • For inbound traffic, provider forwarding support, Gluetun forwarding settings, firewall input ports and the application’s current assigned port all agree.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.