Server

⏱ 6 min read

In one sentence: A server is a program that answers requests from clients, and the word also means the computer that runs such programs, which is usually kept running day and night.

Why should I care?

In Client and Server, you learned that a server is a program that waits for requests and answers them. When you open a web page, a server program on a real computer, somewhere in the world, sends it to you.

People call that computer a server too. When you put your own website online, your files will live on one of these computers.

Analogy

Go back to the library. The librarian at the help desk is like a server program: the one who answers. The library building is like the server computer. One building can have several desks, each with its own librarian. In the same way, one server computer can run several server programs.

Where the analogy breaks down: a library closes at night, and its librarians go home. A server computer is usually kept running all day and all night. Also, a building does no work, but a server computer does: its CPU follows the server programs' instructions.

How it actually works

Two meanings of one word

MDN, a website that documents how the web works, says a server can be "software or hardware". Software means programs. Hardware means the physical machine.

  • A software server is a program that answers requests from clients. Wikipedia says that, in its narrowest meaning, the word "server" means this program.
  • A hardware server is a computer that runs one or more server programs. MDN calls it "a shared computer on a network, usually powerful".

Inside a server computer

A server computer is built from the parts you met in How the Parts Work Together. It has a CPU, memory (RAM) and Storage: HDD and SSD. It also has a connection to a network. MDN says a web server computer stores the server software and the website's files, and connects to the internet.

Wikipedia even says "a laptop or a personal computer can host a web server". (Here, host is a verb: to run a program or keep files for others. It is a different use of the word from "a host on a network".)

But server computers are often different from your laptop:

  • No screen or keyboard. Wikipedia says that servers are usually reached over a network, so many run "without a computer monitor". People manage them from other computers, through the network.
  • Flat boxes in racks. Wikipedia says server cases "are usually flat and wide". They are made to fit in a rack: a standard frame that holds many electronic devices.
  • Data centers. MDN says a hardware server is often kept in a data center, a place that houses computer systems.

A metal rack frame holding ten flat, wide server computers, stacked one above another.ServerRack
Image: Btrs, CC BY-SA 4.0; resized

This diagram shows one server computer, with its parts and its programs, and the clients that send it requests:

Three clients send requests to one server computerThree clients, a laptop, a phone and another computer, each send a request across the network to one server computer. Inside the server computer are its parts (CPU, RAM, storage, network connection) and two server programs: a web server and an email server.

request

request

request

One server computer

Web server
program

Parts: CPU, RAM,
storage, network
connection

Email server
program

Laptop

The network

Phone

Computer

Many programs, many clients

MDN says that several server programs can run on the same machine. Wikipedia names some kinds, such as mail servers and web servers. A web server program sends web pages. One example is the Apache HTTP Server.

Wikipedia also says "a single server can serve multiple clients". And a website that looks like one server to you may be many computers. MDN says a server "appears as only a single machine", but it may be a group of servers sharing the work.

(This is simplified. How a request reaches the right computer, and the right program on it, is a later topic.)

Why servers stay on

A client can send a request at any moment. If the server computer is off, nobody answers. A dedicated web server is a computer used only for this job. MDN says it is always connected to the internet, except at times when it is not working, such as when it has problems.

How it came to be

The first web server ran at CERN, a laboratory where scientists from around the world study the Universe. CERN's history says that by the end of 1990, Tim Berners-Lee had the first web server and browser working there. Tim Berners-Lee, a British scientist, invented the World Wide Web (the system of linked pages that you reach through the internet).

The server was a NeXT computer, which he kept in his office. CERN says that, to stop it from being switched off by accident, it had a hand-written label in red ink: "This machine is a server. DO NOT POWER IT DOWN!!"

🧪 Try it in your browser

You will look at notes that a server adds to its answer. These notes are called headers: short lines of information sent with the response, before the page itself. You need a computer, not a phone. This only looks and changes nothing.

  1. In Chrome, Edge or Firefox, open https://example.com in a new browser tab.
  2. Open the developer tools: a panel of tools built into the browser. (The console you may have used before is one part of it.)
    • Windows: press F12 or Ctrl + Shift + I. If F12 does nothing, try the other keys.
    • Mac: press Cmd + Option + I.
  3. At the top of the panel, click the word Network. (In Edge, if you do not see it, click the More tools button first.) The list is empty at first.
  4. Click your browser's Reload button. Rows appear in the list. You will see many words you do not know. That is fine.
  5. Click the first row. It is usually the page itself. Its name may be example.com, or only a slash: /.
  6. In the details that open, click Headers if it is not already chosen. Then find the Response Headers section.

What you should see: a list of lines, each with a name and a value. Find the line named date (it may be written Date). Its value looks like Tue, 29 Oct 2024 16:56:32 GMT, but with a different day and time. You may also see a line named server.

What happened: a server program, on a server computer somewhere, made this answer and wrote these notes. MDN says the date line holds "the date and time at which the message originated", that is, when the answer was made. The time may not match your clock. HTTP dates are always in GMT (Greenwich Mean Time), never in your local time. The server line, when a site includes it, names the server software. Close the browser tab when you are done.

Common misunderstandings

  • "A server is a giant, special machine." Not always. Many are powerful, but a laptop can run a web server too.
  • "One website lives on one computer." Not always. A website may be served by many computers sharing the work.

Recap

  • "Server" means a program that answers clients' requests, and also the computer that runs such programs.
  • A server computer has a CPU, RAM, storage and a network connection, like other computers, but often no screen. Many sit in racks in data centers.
  • Servers are usually kept running day and night, so they can answer requests at any time.

Sources

Written with AI · Reviewed by AI · Not yet checked by a human

Found a mistake, or something you did not understand? Report a problem.