{"canonical_url":"https://engineer.company/glossary/server/","content_markdown":"# Network server\n\n## What it is\n\nA network server is a program that waits for other programs to reach it across a\nnetwork and then answers what they ask. In everyday speech the word is shortened\nto _server_, and it names both that program and the computer it runs on. The\nprogram at the other end of each exchange is the client: a browser, a phone app,\na script, a mail program, or another server asking a question of its own.\n\nThe standards behind the web put the role first. RFC 9110, which defines HTTP,\ncalls an HTTP server “a program that accepts connections in order to service\nHTTP requests by sending HTTP responses”, and adds that the words client and\nserver describe only the role a program plays on a particular connection. The\nsame program can serve on one connection and ask on the next. A web server that\npasses a request on to an application behind it is that application's client for\nthe second hop.\n\nUnderneath most servers is one move, which TCP calls a passive open. The program\ntells the operating system that it wants to accept incoming connections, either\non one local address or on any of them, and then it waits. A client makes the\nactive open towards that address and port. While nobody is connected, a server\ndoes almost nothing visible.\n\nServers differ in how they wait. Many run for months at a time, holding their\nmemory whether anyone visits or not. Others are started fresh for every\nconnection: a supervising program does the waiting, launches a copy of the\nserver for each visitor, and the copy exits when the visitor leaves.\n\nThen there is the machine. NIST's glossary describes a server as “a computer or\ndevice on a network that manages network resources”, and names file servers,\nprint servers, network servers and database servers as examples. When a company\nsays its site runs on one small server, it means a computer set aside to run\nserver programs, today usually a virtual machine rented from a provider. This\nglossary keeps a firm line between the two words. A server is what answers. The\nmachine, as a thing with a name and an address that is built, secured and\ncounted, is a host. One host can run many servers, and a server can move to\nanother host as long as its name moves with it.\n\nThe kinds most people meet are named for what they serve: web servers for HTTP,\nmail servers for SMTP and IMAP, DNS servers for names, database servers for\nqueries, file servers, git servers and game servers. An application server\nusually sits behind a web server and runs the product's own code.\n\n## Why it matters\n\nEverything a visitor reaches on the internet is answered by some server, so\nchoosing servers is choosing what is exposed, what it costs and what fails\ntogether.\n\nThe first use of the word in a budget conversation is to ask which meaning is on\nthe table. “We need a server” can mean a program to install, a machine to rent,\na managed service that somebody else runs, or more capacity on a machine already\npaid for. Those differ in price, in who applies the security updates and in who\nis woken at night when one of them stops.\n\nThe second is cost, and most of a server's cost is its waiting. A program that\nholds memory while idle holds it around the clock, so on a small machine each\nresident server is a line in the budget. A server started per connection trades\na little time on every visit for nothing held in between.\n\nThe third is exposure. Each listening server accepts input from strangers, which\nmakes it something to keep patched, configure on purpose and watch. Running the\nfewest servers that do the job is a security decision as much as a saving.\n\nThe fourth is that the role can be bought instead of run. A managed database, a\nhosted mailbox or a content delivery network is a server that another company\noperates. The trade is control and visibility in exchange for fewer things to\npatch, and a small company can sensibly run its own web server while renting its\nmail.\n\n## What it looks like in practice\n\nAll of this site's servers fit on one machine, and the credits page\n[names every server program on it](/credits/). Caddy answers every web request\nand renews the HTTPS certificate itself. Agate and Gophernicus answer Gemini and\nGopher, Tor answers the onion address, and Soft Serve is the git server. The\nfour public copies of the site are served from one shared folder, and a single\ndeploy brings every copy up to date at once. The onion service shows that\nserving and listening are separate things: it is the only front door that could\nbe added without opening a port, because tor dials out to introduction points,\nand the machine's open ports stayed exactly as they were. Mail goes to a hosted\nservice, which is the role bought rather than run.\n\nThe privacy page shows the per-connection kind from an angle few people look at.\n[The Gopher copy is started afresh for each visitor by the operating system](/privacy/),\nwhich names that moment after the address the visitor came from and writes the\nname into a log of its own, one the server software never sees. The site found\nthat log the day it first counted requests; it now expires after thirty days.\n\nAnd one machine sets a limit on which servers it can take. The account of\n[running the company's public services on one 512 MB host](/portfolio/a-whole-company-on-one-small-server/)\nkeeps mail off that box on purpose. The mail server exists as an install\nscaffold waiting for a host of its own, because a mail server needs headroom the\nmachine has already spent: a limit written down rather than discovered later.\n\n## Where it goes wrong\n\n**The machine answers and the server does not.** A ping, an open SSH session or\na green tile for the virtual machine all say the host is up. None of them says\nthat the web server is answering, that it returns the right page or that its\ncertificate is still valid. Check a server the way a client uses it, by asking a\nreal question and reading the answer:\n\n```sh\ncurl -sS -o /dev/null -w '%{http_code} %{time_total}s\\n' https://example.com/\n```\n\nA 200 in a sensible time is what a visitor needs. Anything else is a fault,\nwhatever the machine's graphs say.\n\n**The file on disk says one thing and the running server another.** Most servers\nread their configuration when they start or reload and keep it in memory, so an\nedited file changes nothing until the next reload. A restart with a broken file\nleaves no server running at all. Validate the file, then hand it to the running\nserver, then ask the server a question. Caddy's command line covers the first\ntwo steps: `validate` loads and provisions every module as if to start the\nconfiguration without starting it, and `reload` gives the running instance the\nnew one.\n\n```sh\ncaddy validate --config /etc/caddy/Caddyfile\ncaddy reload --config /etc/caddy/Caddyfile\n```\n\n**Two servers do not halve the work of one.** A second copy of an application\nserver behind a load balancer calls every piece of state on the first into\nquestion. Sessions kept in memory belong to one copy, so a visitor sent to the\nother is logged out. A file uploaded to one disk is absent from the other. A\nscheduled job installed on both runs twice. Move sessions, uploads and schedules\nsomewhere both copies share before adding the second, or keep one server and\nmake it faster.\n\n**Every server on one machine shares its fate.** One host carrying many servers\nis cheap and simple, and it also means that one reboot, one full disk or one\nexhausted memory takes every server down at once. For a small site that is a\nfair trade when it is chosen on purpose: the machine is described as code so it\ncan be rebuilt, the data is backed up off the box, and a server that needs\nheadroom of its own gets a machine of its own.\n\n## Further reading\n\n- [server — NIST CSRC Glossary](https://csrc.nist.gov/glossary/term/server) —\n  the definition NIST's publications share, with the kinds of server they name.\n- [RFC 9110, HTTP Semantics: Connections, Clients, and Servers](https://www.rfc-editor.org/rfc/rfc9110.html#section-3.3)\n  — client and server defined as roles a program plays on one connection.\n- [RFC 9293, Transmission Control Protocol](https://www.rfc-editor.org/rfc/rfc9293.html)\n  — passive and active opens, and how a listening program waits on one address\n  or on all of them.\n- [Caddy: Command Line](https://caddyserver.com/docs/command-line) — `validate`,\n  `reload` and the other commands of the web server this site runs.\n\n\u003chttps://engineer.company/glossary/server/\u003e\n","date_modified":"2026-11-08T02:22:23Z","description":"What a network server is, why one program can be a server and a client at once, how one machine runs many, and the four ways a server lets its users down.","formats":{"gemtext":"https://engineer.company/glossary/server/index.gmi","gopher":"https://engineer.company/glossary/server/gophermap","html":"https://engineer.company/glossary/server/","json":"https://engineer.company/glossary/server/index.json","markdown":"https://engineer.company/glossary/server/index.md","pdf":"https://engineer.company/glossary/server/index.pdf"},"kind":"page","language":"en","title":"What is a network server?","url":"https://engineer.company/glossary/server/","version":1}