Monkey is a lightweight HTTP server for Linux written in C. It keeps the core small, favors predictable resource usage, and exposes a plugin-oriented architecture that works both as a standalone web server and as a reusable runtime foundation for HTTP-facing components.
The repository ships the monkey executable, the shared runtime in
mk_core/, the HTTP server implementation in mk_server/, optional plugins,
test targets, fuzzing entrypoints, and the default configuration and site
assets used by local builds.
- Small C codebase with a focused HTTP/1.1 server implementation
- Event-driven scheduler with worker threads
- Virtual hosts, keepalive, range requests, and static file serving
- Optional plugins for TLS, CGI, FastCGI, logging, auth, shell access, and directory listing
- Build-time feature switches through CMake instead of a large external stack
- Suitable for direct server use or embedding-oriented integration work
Requirements:
- Linux
- CMake 3.20 or newer
- A C compiler with GNU99 support
- POSIX threads
Build:
cmake -S . -B build
cmake --build buildRun from the source tree with the bundled configuration:
./build/bin/monkey -c confServe a directory without editing config files:
./build/bin/monkey -o htdocsThe generated binary is:
build/bin/monkey
Useful CMake toggles from the current build system:
MK_TLS=On|Offenable or disable TLS supportMK_TLS_BACKEND=auto|openssl|mbedtlschoose the TLS backendMK_PLUGIN_CGI=OnMK_PLUGIN_FASTCGI=OnMK_PLUGIN_LOGGER=OnMK_PLUGIN_CHEETAH=OnMK_TESTS=Onbuild native test targetsMK_HTTP2=Onenable in-development HTTP/2 code pathsMK_DEBUG=Onbuild with debug symbols
Example:
cmake -S . -B build \
-DMK_TESTS=On \
-DMK_PLUGIN_LOGGER=On \
-DMK_TLS=On
cmake --build buildCommon command-line options:
-c, --configdirset the configuration directory-s, --serverconfchoose the main server config file-p, --portoverride the listen port-w, --workersoverride the worker count-D, --daemonrun in the background--httpsenable HTTPS on configured listeners-b, --buildprint build information-h, --helpshow the full command reference
Configuration templates live under conf/. The default static site content for
local runs lives under htdocs/.
mk_core/core utilities, memory, events, files, strings, and threadingmk_server/HTTP server, scheduler, request lifecycle, headers, streams, virtual hosts, and plugin integrationmk_bin/executable entrypoints and signal handlinginclude/monkey/public and internal headersplugins/optional runtime featurestest/native tests used by CMakefuzz/fuzzing entrypoints and helpersqa/request fixtures and QA materialconf/configuration templateshtdocs/default site assets
Build test targets:
cmake -S . -B build -DMK_TESTS=On
cmake --build buildAdditional notes:
- Fuzzing notes live in FUZZ.md
- Arduino YUN cross-build notes live in ARDUINO_YUN.md
- Contribution rules live in CONTRIBUTING.md
- Local repository conventions for agents live in AGENTS.md
- Repository: https://github.com/monkey/monkey
- Issues: https://github.com/monkey/monkey/issues
- Project site: https://monkeywebserver.com
- Documentation: https://monkeywebserver.com/documentation/
Send changes through GitHub pull requests. Before opening one, read CONTRIBUTING.md and follow the commit style already used in the repository history: narrow scope prefixes, short lowercase subjects, and a proper body for non-trivial changes.
Monkey source files are licensed under the Apache License, Version 2.0.