# Elements vs Hetzner Hetzner is a German hosting company, founded in 1997 and based in Gunzenhausen, Bavaria. It rents dedicated servers from its own data centers in Germany and Finland, and it rents virtual servers through Hetzner Cloud, which also runs in the United States and Singapore. Cloud servers are billed by the hour up to a fixed monthly price. Hetzner also sells object storage, storage boxes for backups, web hosting, and used dedicated servers through a server auction. It is known for low prices for memory, storage and traffic, especially in Europe. Elements is not a hosting company. It is an integrated app environment for building web apps, built for people and their agents: one coherent system that includes a project server that runs while you work, a default app framework, a package installer, a test runner, a bundled Postgres database, and a deploy command. It deploys to any Ubuntu server you rent and reach over SSH, cloud or dedicated. Elements charges for that tooling, per machine, and meters nothing ([pricing](/pricing)). Together, Hetzner and Elements put a complete production app on one low-priced server. Hetzner rents the machine at a fixed monthly price. Elements installs the database and the load balancer on it and sets up HTTPS. Then it ships each change, often in under a second, and holds back any release whose tests fail. While you build, its project server runs on your machine, builds in milliseconds and answers you and your agent in microseconds. That is the job a hosted platform such as Vercel does, here on a server you can log in to, for two prices you know up front: Hetzner's for the server and Elements' for the tooling. ## A Low-Priced Server Is a Complete Production Stack A CX23 cloud server in Germany or Finland, with 2 virtual CPUs, 4 GB of memory, 40 GB of fast NVMe solid-state storage and 20 TB of traffic, is sold at a fixed monthly price ([pricing](https://www.hetzner.com/cloud/)), and its public IPv4 address is billed monthly on top ([IPv4 pricing](https://docs.hetzner.com/general/infrastructure-and-availability/ipv4-pricing/)). Under Elements, that one server carries everything a production app needs. The first deploy installs Postgres, the same version you develop against, and runs the app, its job worker and the load balancer beside it ([deploy](/learn/man/deploy)). You do not set up a separate database server, nginx, certbot, a process manager or systemd units. The server and its IPv4 address are the hosting bill. A low, fixed price per machine goes furthest when one machine does all the work. Hetzner's dedicated servers work the same way once they run Ubuntu ([setup](/learn/man/deploy/setup)). ## Two Fixed Costs per Server Each Hetzner server that runs Elements has two monthly costs: Hetzner's price for the server and its IPv4 address, and one Elements license ([licenses](/learn/man/licenses)). Nothing on the Elements bill is metered: requests, bandwidth and build minutes never appear on it. A busy month costs what a quiet one does, and a CX23 includes 20 TB of traffic a month. [Elements vs Vercel](/vs/vercel) compares this with usage billing in full. ## Deploys Send Only What Changed A hosted platform deploys by uploading your code and building it on its own machines. An Elements deploy sends only the files that changed. The project server on your machine already holds the build graph and build state, and the Hetzner server runs a project server too. `elements deploy` connects the two over SSH, they compare files, and only the changed ones cross ([deploy](/learn/man/deploy)). Before a release goes live, the app's tests run on the Hetzner server and pending migrations apply. If either fails, nothing is released and the previous version keeps serving ([what deploy does](/learn/man/deploy/what-happens)). There is no build queue to wait in, because the build runs on your machine and your server. After the first deploy, a deploy often finishes in under a second. ## Growing to Several Servers Each server runs its own bundled Postgres by default, because the scaffolded `production.env` sets `DB_HOST=127.0.0.1` ([setup](/learn/man/deploy/setup)). That suits a prototype or an app on one server. To grow past one server, or when you want backups and scaling run for you, Elements recommends a hosted Postgres provider such as Neon: set `DB_HOST` and the other `DB_*` values in `production.env` to its connection details, and Elements connects over TLS and creates its databases there ([database CLI](/learn/man/database/cli)). Any Postgres 16 or newer works, including a Hetzner server of its own running Postgres. Then add each server to `config.jsoc` and point your domain at them. Put the servers on a Hetzner Cloud network, or a vSwitch for dedicated servers, and give each its address on that network in the `privateIp` field. Every machine's load balancer spreads requests across the servers over those private addresses, and retries another when one fails ([load balancer](/learn/man/deploy/load-balancer)). Migrations run once, on the first machine ([what deploy does](/learn/man/deploy/what-happens)). ## From a New Server to a Live App In the Hetzner Cloud console, pick a location and plan, choose an Ubuntu image, and attach your SSH key. If you put a Hetzner Cloud Firewall in front of it, add inbound rules for TCP 22, 80 and 443: SSH for deploys, and HTTP and HTTPS for the load balancer, which also answers Let's Encrypt on port 80. Once the server has an address, list it under the production environment in `config.jsoc` with your domain, aim the domain at it, and run: ```bash elements deploy ``` The [walkthrough](/learn/man/deploy/walkthrough) covers each step. ## Questions ### Can I deploy an Elements app to Hetzner Cloud? Yes. Create a server from an Ubuntu image, add its public IP address and your domain to config.jsoc, and run elements deploy. Elements installs itself on the server and sets up Postgres, the load balancer and HTTPS on the first deploy. ### Does Elements work on a Hetzner dedicated server? Yes, once the server runs Ubuntu and you can reach it over SSH. Elements deploys to dedicated and cloud servers the same way, and several dedicated servers can share a vSwitch for private traffic. ### Do I need a separate database server on Hetzner? Not for one server. Elements installs and sets up Postgres on the deploy machine, so one server runs the app and its database. When you run several servers, or want managed backups, point DB_HOST at a hosted Postgres so they all use the same data. ### How much does it cost to run an Elements app on Hetzner? Two fixed monthly amounts per server: Hetzner's price for the server and its IPv4 address, and one Elements license. Nothing on the Elements bill is metered. ### Which ports does an Elements server on Hetzner need open? Three: TCP 22, because elements deploy connects over SSH, and TCP 80 and 443, where the load balancer serves the app. Let's Encrypt also reaches the server on 80 to issue and renew certificates.