Full Byte Developer.

What is a server?

A server is hardware, software, or both: a machine or program that answers client requests.

Published here , updated · 4 sources

A server is hardware, software, or both: a computer on a network, a program that answers client requests, or the two together. MDN: "A server is a software or hardware offering a service to a user, usually referred to as client." [1] Cloud hosting is optional. Pair with what is the cloud when you rent the box.

Quick start: start a tiny software server on localhost

Python's standard library can listen for HTTP and answer a GET without any cloud account [4]. This demo binds to 127.0.0.1:18765, returns a fixed body, then shuts down:

bash
python3 <<'PY'
from http.server import BaseHTTPRequestHandler, HTTPServer
import threading
import urllib.request

class Handler(BaseHTTPRequestHandler):
    def do_GET(self):
        body = b"hello from glossary demo\n"
        self.send_response(200)
        self.send_header("Content-Type", "text/plain; charset=utf-8")
        self.send_header("Content-Length", str(len(body)))
        self.end_headers()
        self.wfile.write(body)

    def log_message(self, *args):
        pass

server = HTTPServer(("127.0.0.1", 18765), Handler)
thread = threading.Thread(target=server.serve_forever, daemon=True)
thread.start()
with urllib.request.urlopen("http://127.0.0.1:18765/") as response:
    print("STATUS", response.status)
    print("BODY", response.read().decode())
server.shutdown()
PY

Captured on this host:

text
STATUS 200
BODY hello from glossary demo

The Python process is the software server. The urlopen call is the client. Nothing about a datacenter is required [1][2].

Name both hardware and software meanings

MDN Learn: on the hardware side, a web server is a computer that stores web server software and website files and connects to the internet; on the software side, at minimum it includes an HTTP server that understands URLs and HTTP and delivers hosted content [2]. The term can mean hardware, software, or both together [2]. MDN's glossary splits the same way: a hardware server is a shared computer on a network; a software server is a program that provides services to client programs [1].

A dedicated box is typically more available and always connected, and may have a stable IP [2]. People rent a VPS for that convenience. A laptop running the demo above is still a server for that loopback request.

When someone says "the server is down," ask which meaning they mean. Hardware power and network path failures look different from a process crash on a healthy machine. The process vocabulary lives in what is a process.

HTTP request and response Client browser or curl GET / Software HTTP server accept + respond 200 with body, or 404 when missing [2][3]

A client such as a browser or curl sends GET slash to a listening HTTP program. That software server accepts the request and answers with 200 plus a body, or 404 when the document is missing, matching MDN Learn and RFC 9110.

Follow the HTTP request and response loop

Browser sends an HTTP request. Software on a machine answers with a response, or a 404 if not found. MDN Learn: when a browser needs a file, it requests via HTTP; the software HTTP server accepts the request, finds the document, and sends it back, or returns a 404 when the document is missing [2]. Clients must provide the file's URL; the web server must answer every HTTP request, at least with an error message [2].

RFC 9110 section 3.3: "An HTTP 'client' is a program that establishes a connection to a server for the purpose of sending one or more HTTP requests. An HTTP 'server' is a program that accepts connections in order to service HTTP requests by sending HTTP responses." [3] Roles are per connection; the same program can be client on some connections and server on others [3].

That last sentence stops a common interview trap. A reverse proxy is a server to browsers and a client to upstreams on other sockets. Naming the role per connection keeps the design review honest.

Serve files with the module form

A shorter teaching alternative from the Python docs is the module form [4]:

bash
python3 -m http.server 8000 --bind 127.0.0.1

In a second terminal:

bash
curl -i http://127.0.0.1:8000/

That serves files from the current directory. Prefer the fixed-body demo above when you want a known response without depending on cwd files. Stop the module server with Ctrl+C when you finish.

Static stacks send files as-is. Dynamic stacks add an application server and often a database so content can be generated before the response [2]. Mail, file, and print services also use client and server roles; RFC 9110 defines the HTTP case specifically [1][3].

Separate the box from the program in everyday talk

Hardware server talk shows up when people discuss rack space, power, NICs, and disks. Software server talk shows up when people discuss ports, workers, and request handlers. Cloud marketing often collapses both into "a server," which is fine for shopping and fuzzy for debugging.

On a rented VPS you still run software servers. The provider owns the hardware meaning; you own the process that listens. When browsers talk to that host on port 443, read what is HTTPS. When the contract for calling that program is the point, pair this page with what is an API.

Latency along the path is a separate glossary: what is latency. CDN edges that absorb download spikes still sit on servers somewhere; see what happens when millions press download.

Common mistakes with the word server

Calling only cloud VMs servers while treating a laptop demo as "not a real server." The software meaning does not require a provider account [1][2].

Blaming "the server" for a DNS or TLS failure before checking which hop answered. Split resolution, TCP, TLS name match, then HTTP status [3].

Treating one physical box as one logical service. Several software servers often share one host on different ports.

Treating a 404 as proof the machine is offline. A 404 is still a successful HTTP conversation with a not-found body [2].

Confusing client and server roles when a program opens outbound connections while also accepting inbound ones [3].

Depth: availability is not the definition

MDN notes that dedicated machines are often always on and always connected [2]. That property makes them useful for public websites. It is still not what the word means. An intermittently available process that answers when it is up is still a software server for the requests it accepts.

Likewise, a load balancer in front of many application processes does not invent a new meaning. Each listening process is a server on its connections; the balancer is a server to clients and a client to backends.

Depth: ports, sockets, and one machine

One IP can host many software servers. Port numbers separate them. 127.0.0.1:18765 in the demo is loopback only: nothing outside the host should reach it unless you rebind. Binding 0.0.0.0 exposes the listener on every interface, which is a different operational choice than the glossary definition.

When you debug "port already in use," you are usually colliding two software servers on the same address and port, not discovering that hardware servers cannot share a rack. List listeners with your platform's tools, then decide which process should own the port.

When the word is enough

In a design doc, write "HTTP server process" or "rented VM" when the difference matters. In casual speech, "server" is fine if the room shares context. The glossary job is to keep both meanings available so a missing cloud bill never becomes "we have no servers" while a Python process answers on localhost [1][4].

Browse the Dev explainers topic.

Send this to the friend who pictures a server as a giant mystery box in a cold room.

A dark machine slab with a glowing service cube on top, receiving a teal request arrow from a small client token on the left and returning an amber response arrow, shown as a clean geometric diagram on a faint navy grid with no typography or people.
A server can be the machine, the program that answers, or both together.

Keep this guide

By Full Byte Developer

Filed under Dev explainers

Questions about this guide

Does a server have to live in the cloud?

No. MDN's glossary covers hardware and software servers on a LAN or the internet. Cloud hosting is one model; see what is the cloud for that model.

Is server always a physical box?

No. MDN Learn says web server can mean hardware, software, or both together. The common web case is an HTTP program answering requests.

What does RFC 9110 call an HTTP server?

A program that accepts connections in order to service HTTP requests by sending HTTP responses. The same program can be a client on other connections.

Sources

Next in this stack