visual-studio-codevpnself-hostingvscode-servercoder

Accessing Self-Hosted Visual Studio Code Server via ZeroTier VPN


I have set up a self-hosted Coder server on our internal workstation server machines. Currently, for remote VS Code development, we can access the workspaces through the tunnel https://<GUID>.pit-1.try.coder.app. However, I would also like to access the Coder server through our ZeroTier VPN.

ZeroTier is an encrypted, layer-2-stretch multipoint VPN with integrated firewalling capability. I believe accessing our self-hosted Coder server should be possible using the IP address provided by our ZeroTier network. However, after reading the Coder documentation (https://coder.com/docs/v2/latest/admin/configure), I cannot find the necessary information to configure this setup.

Has anyone successfully set up a self-hosted Coder server to be accessible through a VPN? If so, could you please guide how to achieve this configuration?


Solution

  • Usually it's as simple as telling an application (in this case Coder) to listen on an address that matches the assigned address on the ZeroTier interface.

    Use the following to get the assigned ZeroTier IP address for a specific network:

    zerotier-cli listnetworks
    

    Then set:

    export CODER_HTTP_ADDRESS=<zerotier-ip>:<port>
    

    I haven't personally used Coder and there might be a better way (via a config file instead of exporting a environment variable) but generally that's what you want to do.

    Good luck!