Quick Answer
A server is a computer, physically similar to your laptop, that is kept on 24/7, connected to the internet, and configured to respond to requests. When you visit a website, your browser sends a request to a server, which processes it and sends back a response. Every web app you use runs on servers.

The client-server model

Every interaction on the web is a conversation:

  1. Client (your browser, phone, or app) sends a request: “Give me the homepage of example.com”
  2. Server receives the request, processes it, and sends a response: the HTML of the homepage
  3. Client receives and displays the result

This request-response pattern underpins everything: loading a web page, calling an API, sending a form, streaming a video. The details vary; the model is always the same. More: Client-server model, MDN

What makes a server different from your laptop?

Physically, almost nothing. A server is a computer with a CPU, RAM, and storage. What differs:

  • Always on, servers run 24/7. A web app cannot go offline at night.
  • No screen, servers are managed remotely via the terminal (SSH), not by sitting in front of them.
  • Optimised for throughput, servers handle thousands of simultaneous connections; your laptop handles one.
  • Located in data centres, dedicated buildings with backup power, cooling, redundant internet connections, and physical security.
  • Accessible by IP address, anyone with the right credentials can connect from anywhere in the world.

A laptop could technically be a server. In fact, your computer is a server when you run npm run dev, it listens on port 3000 and responds to requests from your own browser.

Types of servers

TypeRoleExamples
Web serverServes static files over HTTPnginx, Apache
Application serverRuns backend code, processes requestsNode.js, Python (Gunicorn), Go
Database serverStores and retrieves structured dataPostgreSQL, MySQL, Redis
File/object storage serverStores and serves files, images, videosS3, Cloudflare R2, MinIO
Email serverSends and receives emailPostfix, SendGrid
Cache serverStores frequently accessed data in memoryRedis, Memcached
Reverse proxySits in front of other servers, routes and load-balancesnginx, Cloudflare

In practice, one physical machine often runs several of these simultaneously. A small startup might run their entire stack on a single server. A large company might have hundreds of servers for each role.

Containers: solving “it works on my machine”

A classic problem: code works on your laptop but fails when deployed to the server. Different operating systems, different library versions, different configurations.

Docker solved this. You define your application and its dependencies in a Dockerfile. Docker packages everything into a container, a portable unit that runs identically on any machine with Docker installed. More: Docker getting started

dockerfile
FROM python:3.12
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "app.py"]

This container will run exactly the same on your laptop, on AWS, on Google Cloud, or in any data centre. No “works on my machine” anymore.

Kubernetes orchestrates containers at scale, deciding which server runs which containers, restarting failed containers, scaling up under load. Most large deployments use it. More: Kubernetes

Serverless: code without infrastructure

Serverless platforms (AWS Lambda, Cloudflare Workers, Vercel Functions, Netlify Functions) let you deploy individual functions rather than whole applications. You write a function, push it, and the platform:

  • Runs it on request
  • Scales automatically from zero to millions of executions
  • Bills you per invocation, not per hour

For a simple API endpoint or a webhook handler, serverless is often the simplest and cheapest option. For long-running processes or stateful applications, it is less suitable.

Where to host your first project

PlatformWhat it isBest for
VercelServerless deployment with Git integrationNext.js, React apps, APIs
RailwaySimple container hostingAny backend, databases
RenderPaaS with free tierAPIs, web services, cron jobs
Fly.ioContainer deployment close to usersLow-latency global apps
AWS / GCP / AzureFull cloud platformsProduction apps, complex infrastructure
DigitalOceanVPS and managed servicesMore control than PaaS, less than raw AWS

For a prototype or demo: start with Vercel, Railway, or Render. You push code from GitHub and it deploys in minutes. No server management required.

The request lifecycle

What actually happens when someone visits your web app:

  1. Browser resolves the domain to an IP address via DNS
  2. TCP connection established with the server
  3. Browser sends HTTP request
  4. nginx (or another reverse proxy) receives it, passes to your app server
  5. Your app server runs your code: reads the request, queries the database, applies logic
  6. Database server returns data
  7. App server formats the response (JSON, HTML)
  8. nginx sends the response back to the browser
  9. Browser renders the result

This happens in under 100ms for well-optimised apps.

Request lifecycle: browser to database and back
Client Browser Sends HTTP GET to the domain. DNS resolves it to an IP.
Edge / Proxy nginx / CDN Terminates TLS, serves static files, routes dynamic requests to the app.
App server Your code Processes request, applies business logic, queries database.
Data layer DB + Cache PostgreSQL for persistent data; Redis serves cached results in microseconds.
A dark industrial floor with red neon grid seams laid in precise layers: infrastructure built in sections, each zone isolated and addressable.
A production server stack. Each layer handles a specific concern: edge caching, load distribution, application logic, data persistence. This is what deploying to the cloud actually means. The grid is already there. You configure how traffic moves through it.

Further reading

What’s next

Next: What is the Cloud? , what “the cloud” actually means and why everyone moved there.