Vikunja vs. Super Productivity: Choosing a Self-Hosted Todoist Alternative
If you want to replace Todoist with task software you control, choose based on how you manage tasks. Vikunja runs on a…
code-server runs a VS Code-compatible editor on a Linux machine and displays it in a web browser. To make it available at a public domain, put a reverse proxy in front of it. A reverse proxy accepts browser requests and forwards them to code-server. It can also handle HTTPS, which encrypts traffic between the browser and the proxy.
When the proxy and code-server run on the same machine, bind code-server to 127.0.0.1:8080. This loopback address accepts connections only from that machine. Then configure NGINX or Caddy to forward requests for the public hostname to that local address. Keep authentication enabled: HTTPS encrypts traffic in transit, but it does not decide who can sign in.
Install code-server using the project’s Linux installation instructions. The documented installer command is:
curl -fsSL https://code-server.dev/install.sh | sh
This command downloads and runs a shell script. If you prefer not to run a downloaded script, use a distribution package described in the installation instructions.
On Debian or Ubuntu, the documented command enables and starts a per-user systemd service:
sudo systemctl enable --now code-server@$USER
After code-server starts, inspect ~/.config/code-server/config.yaml. The default configuration uses password authentication, stores the password there, and listens on 127.0.0.1:8080 without TLS. Keep the loopback address so outside clients cannot bypass the reverse proxy and connect directly to code-server. The code-server FAQ describes these defaults.
Create a DNS A record, which maps a hostname to an IPv4 address, for the hostname you plan to use, such as code.example.com. Point the record to the server’s public IP address. The server must accept the web traffic needed for the proxy and HTTPS certificate setup. Use a dedicated hostname with the editor at /; this keeps the proxy configuration straightforward.
A reverse proxy forwards traffic from the public hostname to code-server. When the proxy handles HTTPS and forwards requests to http://127.0.0.1:8080, HTTPS encrypts the connection between the browser and proxy. The proxy connects to code-server using HTTP over the server’s local loopback interface.
Choose one reverse proxy. The code-server proxy guide provides examples for both NGINX and Caddy.
Create an NGINX site configuration for your hostname:
server {
listen 80;
listen [::]:80;
server_name code.example.com;
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 3600s;
}
}
WebSockets are persistent, two-way connections that code-server uses to communicate with the browser. NGINX needs the Upgrade and Connection headers to pass that connection through. NGINX’s WebSocket proxying documentation explains why the proxy must forward those headers. The one-hour proxy_read_timeout above is a suggested starting value, not a code-server requirement. NGINX’s documented default is 60 seconds; other proxies, firewalls, or network services can impose their own timeouts.
Install NGINX and Certbot, then enable the site and request a certificate. Save the configuration above as /etc/nginx/sites-available/code-server before running these commands:
sudo apt update
sudo apt install -y nginx certbot python3-certbot-nginx
sudo ln -s ../sites-available/code-server \
/etc/nginx/sites-enabled/code-server
sudo certbot --non-interactive --redirect --agree-tos \
--nginx -d code.example.com -m admin@example.com
Replace the example hostname and email address with your own. Certbot configures HTTPS and redirects HTTP requests to HTTPS.
Caddy can handle HTTPS certificates automatically for an eligible public domain. Its reverse-proxy directive also supports WebSockets, so the basic configuration does not need explicit upgrade headers:
code.example.com {
reverse_proxy 127.0.0.1:8080
}
Use this Caddy configuration instead of the NGINX configuration. Check the Caddy example in the code-server guide when adapting it to your deployment.
The reverse proxy provides a route to code-server, but it does not automatically provide user sign-in. Keep code-server’s password authentication enabled unless a separate identity service is configured to protect the editor route. A public editor endpoint without authentication gives an unauthorized visitor access to the editor and its terminal. The project warns that this exposure can let someone take over the server.
code-server’s documented login limit is two attempts per minute, plus twelve per hour. That limit does not replace a strong password or a separate, working sign-in service. If you add an external sign-in service, confirm that it protects the editor URL and that no other public URL reaches code-server without authentication. The project names Pomerium, oauth2-proxy, and Cloudflare Access as possible integrations, but each needs its own correct configuration.
Hosting the editor at a subpath, such as code.example.com/code/, needs additional proxy path rules and testing. Start with a dedicated hostname and / unless you have a specific reason to use a subpath. A separate reverse-proxy security overview covers broader access-control concerns.
If the hostname does not load, first confirm that code-server is running. Then check that its configured bind address and port match the address the proxy forwards requests to, called the upstream address. On the same host, the expected address is 127.0.0.1:8080.
If the page loads but the editor fails to connect or disconnects, check the WebSocket configuration. With NGINX, verify that both upgrade headers appear in the active site configuration. If an idle editor session closes after a period of time, check proxy_read_timeout and the timeout settings of any other proxy or network service between the browser and server. NGINX documents its proxy timeout behavior.
Finally, visit the public hostname in a private browser window. Confirm that the browser uses HTTPS and prompts for the intended authentication. A private window helps show whether a previous login session was hiding a route that lacks authentication.
Give Vroni a GitHub issue, bug report, spec, or rough idea. It reads the repo, plans the change, writes code, runs checks, and works toward a review-ready pull request.
Take a look at vroni.com