Your own servers: AWS EC2 and Lightsail

Play this lesson

A server that never sleeps

Co-op Hyper Shards needs a game server: a program that runs each match tick by tick and keeps a live connection open to every pilot (see Multiplayer: who decides what happened?).

Our current tools aren't built for that. Cloud Functions wake up for one short job and finish. Firestore stores data; it doesn't run a game. Cloudflare serves our files. A game server must keep running for as long as players are in a match. So, for the first time, the studio might need a computer of its own.

Managed or your own?

Serverless doesn't mean there are no servers. It means the servers are someone else's job.

Need a server?

Which Hyper Shards feature really needs a server that runs the whole time players are online?

  1. The daily leaderboard, rebuilt every 5 minutes
  2. Cloud saves for every pilot
  3. Live co-op matches simulated many times a second
  4. The game's files on our website
Show the answer

Live co-op matches simulated many times a second

A scheduled Cloud Function rebuilds the board, Firestore keeps the saves and Cloudflare serves the files, all managed for us. A live match must be simulated nonstop while pilots play, which is a game server's job.

AWS EC2: computers by the second

AWS (Amazon Web Services) is Amazon's cloud. Its EC2 (Elastic Compute Cloud) rents virtual servers called instances.

Auto Scaling can add and remove instances as players come and go. A server left on all month is billed all month, even with zero players.

Who looks after what?

AWS calls the split the shared responsibility model. AWS looks after the buildings, the physical machines and the network between them. On an EC2 instance, the customer manages the operating system, including updates and security patches, all the software they install, and the firewall, which AWS calls a security group.

A security patch fixes a weakness attackers could use. Automated bots probe servers on the internet all day, so an unpatched server is an open door.

Quick check

When we rent an EC2 instance, AWS installs the security patches for its operating system for us.

Show the answer

False

Under AWS's shared responsibility model, the customer manages the operating system on the instance, including updates and security patches. AWS looks after the hardware and the data centres.

Lightsail: the simpler box

Amazon Lightsail is AWS's simpler way to rent a server. AWS calls it the easiest way to get started with AWS for websites and web apps.

A Lightsail instance is a virtual private server sold as a bundle: memory, processors, SSD storage and a data transfer allowance, for a low, predictable monthly price. Sending out more data than the allowance costs extra, and snapshots make backups.

It's still your server, so patching is still your job. Prices change, so check the current price on AWS's Lightsail pricing page.

Pick the server

#studio-chat, Remy
For the co-op test we need one small game server, a simple setup and the same bill every month. No giant fleet yet.

Which option fits Remy's plan?

  1. One Lightsail instance with a monthly bundle
  2. A fleet of EC2 instances with Auto Scaling in five regions
  3. A Cloud Function called many times a second by every player
Show the answer

One Lightsail instance with a monthly bundle

Lightsail bundles one server at a predictable monthly price, which suits a small test. EC2 with Auto Scaling is powerful but much more to set up and watch, and Cloud Functions are made for short jobs, not for running a match nonstop.

The hidden costs

The rent is only part of the bill. A server also costs time, every week.

Other roads to the same goal

Other clouds rent virtual machines too, such as Google Cloud's Compute Engine and Microsoft's Azure Virtual Machines. There is also a middle ground: Cloudflare Durable Objects can act as WebSocket servers (a WebSocket is a connection that stays open both ways) that coordinate many players, for chat rooms or multiplayer games, with no machine to patch.

Our rule: stay managed until a feature truly needs a server running all the time. Next: the full fight against cheaters.

Bolt says: Before renting a server, ask the team: who will patch it, back it up and wake up when it breaks?

Fact-checked 9 October 2026