8-Bit Microcontroller Website Hosting: Inside the MCUSite Project
Discover how an 8-bit microcontroller hosts a website in real time. Explore the MCUSite project, its custom TCP/IP stack, and lessons for constrained systems.
The MCUSite project hosts a website from an 8-bit microcontroller. No Raspberry Pi. No ESP32. Just an ATmega1284P and an ENC28J60 Ethernet chip serving HTTP directly. The page loads slowly, HTML streaming in like it's 1995—and it works. Here's what makes this tiny feat a big deal for builders who care about constraints.
The MCUSite Project: How It Works
Maurycy Z's MCUSite serves a website directly from an 8-bit microcontroller. The chip is an ATmega1284P, a 20-year-old AVR running at 14.7456 MHz with 128 KB of flash and 16 KB of RAM. It uses an ENC28J60 standalone Ethernet controller for networking.
Everything fits in under 128 KB: the lightweight RTOS (or bare-metal loop), a custom TCP/IP stack, the HTTP parser, and the web content. The HTML page is a few kilobytes, but the server streams it because RAM is too scarce to buffer the whole response. You can watch the page assemble byte by byte in your browser.
Why It Resonates with Engineers
The single non-flagged comment on the Hacker News thread captures the sentiment:
I love how I can see the HTML being streamed onto the page in real time, like the good old days of dialup when images gradually rendered from top-to-bottom.
The project triggers nostalgia for a web that felt tangible. It also highlights the contrast between a 128 KB microcontroller and a multi-megabyte JavaScript framework. The post earned 46 points on HN—not because it's practical, but because it speaks for itself.
Technical Breakdown of the ATmega1284P Web Server
Let's look at the key components that make 8-bit microcontroller website hosting possible:
- Custom TCP/IP stack: The microcontroller runs a hand-rolled stack—no heavy lwIP here. Libraries like uIP are suitable for such constrained environments.
- Streaming HTTP responses: With only 16 KB of RAM, buffering the entire HTML page is impossible. The server uses HTTP/1.1 chunked transfer encoding (see MDN docs) to send headers, then stream the body in chunks.
- Static content: The site is preformatted HTML. No server-side rendering, no database—just a
GETrequest that returns a string of text.
A simplified example of the streaming logic in C pseudocode:
void handle_index() {
http_send_header(200, "text/html");
http_stream_chunk("<html><body><h1>Hello</h1>");
http_stream_chunk("<p>This page is served from an AVR.</p>");
http_stream_chunk("</body></html>");
http_finish();
}
This isn't a party trick. The same principles apply to low-power sensors, edge devices, or control panels that only need a web interface. You could implement a similar server on a $2 chip rather than a $30 module.
Lessons for Building on Constrained Systems
If you're building for IoT, edge, or low-budget projects, the MCUSite project proves that a web interface can be simpler than you think.
- Static content is fine: If your site doesn't change often, serve preformatted HTML. Avoid server-side rendering and databases.
- Stream responses: Don't buffer the entire response. Use chunked transfer encoding to send data as it becomes available.
- Lean networking: Use minimal TCP/IP implementations. The ENC28J60's datasheet (Microchip ENC28J60) provides a starting point for low-level Ethernet control.
The trade-off is performance and concurrency. But for many use cases—like a status page that serves one request at a time—it's more than enough.
Should You Build on an 8-Bit MCU?
If you're building web apps for the general public, no—stick with React and Node.js. But if you're an embedded engineer, a hobbyist, or someone tired of web bloat, this project is a refreshing reminder of what's possible with minimal resources. Building your own TCP/IP stack teaches you more about networking than any high-level framework.
Give it a spin, even if just for fun. Check out the MCUSite project and the original Hacker News discussion.
Originally posted on Hacker News: Hosting a website on an 8-bit microcontroller.