DEV Community

MrChifir
MrChifir

Posted on AI-assisted

I Built an Open-Source VPN Manager to Simplify Self-Hosting

I've always liked the idea of running my own infrastructure instead of depending entirely on third-party services. One thing that bothered me, however, was how much manual work was involved in setting up and maintaining a personal VPN server.

You need to connect to a VPS over SSH, install the necessary software, generate keys, configure protocols, create client configurations and make sure everything works correctly.

I wanted to make this process simpler, so I started building Eleutheria.

Eleutheria is an open-source desktop application and CLI for deploying, connecting to and managing your own VPN infrastructure using sing-box.

The idea

The main concept is that you bring your own VPS, and Eleutheria handles the installation and configuration.

Instead of manually configuring everything through a terminal, you can enter your server's SSH credentials, verify its fingerprint and let the application deploy sing-box.

Once the installation is complete, Eleutheria generates connection links and QR codes for your users.

You can then connect through a local proxy or use a system-wide VPN through a TUN interface.

The application doesn't require a subscription to a third-party VPN service. You control the server and its configuration.

What can Eleutheria do?

Some of the features I've implemented so far:

  • Automated server provisioning over SSH.
  • VLESS + Reality as the primary VPN protocol.
  • Additional protocols: Hysteria2, TUIC, Shadowsocks 2022 and VLESS + WebSocket through a CDN.
  • User management with individual UUIDs and connection links.
  • System-wide VPN using TUN.
  • Local HTTP and SOCKS5 proxy support.
  • Automatic server selection based on latency.
  • Automatic failover between servers.
  • Traffic-based routing for video platforms, messengers, social networks and AI services.
  • Management of multiple VPS instances.
  • Server configuration updates and rollback on failure.

One feature I find particularly interesting is traffic-based routing.

Instead of treating all traffic identically, Eleutheria can monitor different categories separately. For example, video platforms, messaging services and AI services can use different routes.

This makes it possible to move only a problematic traffic category to another route instead of changing the connection for everything.

Why Rust and Tauri?

I chose Rust for the core because I wanted a single implementation that could power both the CLI and desktop application.

The project is split into several crates:

  • eleutheria-core — server provisioning, SSH, configuration generation, protocol profiles, server management and client logic.
  • eleutheria-cli — command-line interface.
  • eleutheria-helper — privileged service responsible for system-level TUN operations.
  • eleutheria-app — application service layer, updates, privilege management and server setup.
  • eleutheria-gui — Tauri 2 desktop application.

The GUI and CLI share the same core library. This means that the main functionality doesn't need to be implemented twice.

For the frontend, I use a lightweight static interface without a bundler.

Security considerations

Since Eleutheria manages network configuration and requires elevated privileges for certain operations, security is an important part of the design.

A few implementation details:

  • SSH server fingerprints are verified and pinned. If a server's key changes, the application blocks the connection until the change is explicitly acknowledged.
  • The sing-box binary is downloaded locally and its SHA-256 checksum is verified before it is uploaded to the VPS.
  • Server configurations are validated with sing-box check before the service is restarted.
  • If the service fails to start after an update, the previous configuration is restored.
  • SSH credentials and server secrets are stored using the system keyring where available.
  • The privileged helper doesn't accept arbitrary sing-box configurations. It receives validated server data and builds the configuration itself.

On Linux, the helper uses a Unix socket with permission checks and SO_PEERCRED. On Windows, it uses a named pipe with an access-control list.

There is still room to improve the security model, particularly around sandboxing the privileged helper.

Current state and limitations

Eleutheria currently supports Windows and Linux. macOS builds are available through CI, but I haven't tested them on a physical Mac.

There are some limitations worth mentioning:

  • Only Ubuntu and Debian servers with root access are currently supported.
  • VLESS + Reality is the primary protocol; the fallback protocols have received less testing.
  • There is no kill-switch yet. If the helper or sing-box stops, traffic can go directly through the normal network connection.
  • Some advanced routing configurations still need more real-world testing.

The screenshots in the README use test data and a mock backend. They demonstrate the interface, not a fully completed end-to-end session. I'm particularly interested in feedback from people willing to test the actual installation and connection workflows.

Feedback and contributions

Eleutheria is released under the GPL-3.0 license.

I'm looking for feedback from Rust developers, Linux users, self-hosting enthusiasts and anyone familiar with sing-box.

In particular, I'd like to hear your thoughts on:

  • The overall architecture and separation between the core, CLI, GUI and helper.
  • The security model and privileged operations.
  • Features that would make managing multiple VPN servers easier.
  • Potential compatibility issues or missing functionality.

You can find the source code, installation instructions and latest releases here:

GitHub: https://github.com/MrChifir/Eleutheria

Contributions, suggestions and constructive criticism are welcome.

Thanks for reading!

Top comments (0)