Deploy Japka
Install the CLI with Cargo to serve files from your machine, run the published container for a bundled sample site, or deploy the release manifest to Kubernetes. Each example ends with an HTTP request so you can verify what a client receives.
Let your AI help you set up Japka
Section titled “Let your AI help you set up Japka”Copy the setup prompt from the documentation home.
Install with Cargo
Section titled “Install with Cargo”Cargo compiles Japka 0.4.0 and its native HTTP/3 dependencies. Install the source build prerequisites before running:
cargo install --locked japkajapka --versionPrebuilt archives are available for Linux x86-64, Apple Silicon macOS, and Windows x86-64. Release assets
To serve an existing site, open a terminal in the directory containing your public website files. Check that Japka can read the site, then start the server.
DOCUMENT_ROOT=. japka config test && DOCUMENT_ROOT=. japkaIf you don’t have a site yet, create a temporary directory with a single page and serve it.
export DOCUMENT_ROOT="$(mktemp -d)"printf '%s\n' 'Hello from Japka' > "$DOCUMENT_ROOT/index.html"japka config test && japkaWith the server running, use a second terminal to fetch the page. The sample returns Hello from Japka. Press Ctrl-C in the server terminal to stop it.
curl --fail http://127.0.0.1:8080/Japka serves ./public by default. Set DOCUMENT_ROOT to change the site directory and LISTEN to change the bind address. To send requests under /api/ to an application on the same machine, start Japka with UPSTREAMS=127.0.0.1:9001 and your usual document root. Routing and load balancing
Docker
Section titled “Docker”The published image includes a sample site and supports Linux AMD64 and ARM64. This command exposes it on port 8080 on your machine.
docker run --rm --name japka -p 127.0.0.1:8080:8080 ghcr.io/japka-org/japka:latestIn a second terminal, run curl --fail http://127.0.0.1:8080/. Look for Japka is running in the response. Run docker stop japka before starting another example on the same port.
Serve your own site
Section titled “Serve your own site”From the directory containing your public website files, mount that directory read-only over the image’s document root. The image runs as UID/GID 10001:10001 and needs permission to read files and traverse directories.
docker run --rm -p 127.0.0.1:8080:8080 \ --mount "type=bind,src=$PWD,dst=/app/public,readonly" \ ghcr.io/japka-org/japka:latestFor a reverse proxy, attach Japka to the backend’s Docker network. For example, add --network app-net -e UPSTREAMS=api:9001 before the image name if the backend is reachable as api on that network.
Use a configuration file
Section titled “Use a configuration file”If your routes are in config/japka.json, mount the directory and validate the file inside the image. Include any site or certificate mounts the server will use.
docker run --rm --mount "type=bind,src=$PWD/config,dst=/etc/japka,readonly" \ -e JAPKA_CONFIG=/etc/japka/japka.json ghcr.io/japka-org/japka:latest config testTo start the server, keep the mounts and environment, add -p 127.0.0.1:8080:8080 before the image name, and omit the trailing config test.
Kubernetes
Section titled “Kubernetes”The Kubernetes manifest runs two replicas of the published Japka image and exposes a ClusterIP Service on TCP port 8080. You need kubectl and a cluster whose nodes can pull the GHCR image. Download the manifest to your deployment directory and check which cluster you are targeting.
curl -fL -o kubernetes.yaml https://raw.githubusercontent.com/japka-org/japka/main/deploy/kubernetes.yamlkubectl config current-contextReview the manifest and choose an existing namespace. The example uses default. For a reproducible production rollout, replace the image’s :latest tag in the manifest with the release image digest before applying it.
namespace=defaultkubectl -n "$namespace" apply -f kubernetes.yamlkubectl -n "$namespace" rollout status deployment/japkakubectl -n "$namespace" get deployment japkakubectl -n "$namespace" port-forward service/japka 8080:8080Check that the Deployment reports 2/2 ready. Leave the port-forward running and use curl --fail http://127.0.0.1:8080/ in another terminal to verify the bundled page. The Service is reachable inside the cluster as japka:8080 from the same namespace.
To serve your own site, mount a read-only volume at /app/public or supply an image containing your files. To proxy to a Service named api in the same namespace, add UPSTREAMS with value api:9001 to the Japka container’s env in the manifest. Apply the edited file and check an application URL under /api/.
Review configuration changes
Section titled “Review configuration changes”Run japka config test with the same working directory, environment, and files that the service will use. To review a proposed JSON file, run japka config plan active.json candidate.json --json and inspect its review entries. Unix processes can reload supported file settings with SIGHUP. Changes to startup environment variables require a new process. Configuration review walkthrough · Reload procedure
Verify the deployment
Section titled “Verify the deployment”- Both replicas report ready.
- A request through the forwarded Service returns HTTP 200.
- The response contains the bundled page or the content you deployed.
Other deployment options
Section titled “Other deployment options”- Prebuilt binaries. The release archives include the executable and sample site. Extract the archive and start Japka from the directory containing
public/. Release downloads - TLS and additional ports. HTTPS uses TCP. HTTP/3 also needs UDP on the TLS port. For TCP or UDP forwarding, expose each listener’s port and protocol on the Service. HTTPS and HTTP/3 on Kubernetes · TCP and UDP forwarding
Build from source
Section titled “Build from source”Install the source build prerequisites, then run cargo build --release --locked from the repository root. To build an image with the native tools installed in the build stage, run docker build -f deploy/Dockerfile -t japka ..
Source build prerequisites
Section titled “Source build prerequisites”Both a Cargo install and a repository build need a stable Rust toolchain (HTTP Kit requires Rust 1.95 or newer), CMake 3.22 or newer, and native tools for quiche and BoringSSL.
- On Debian or Ubuntu, install
build-essential cmake clang libclang-dev. - On macOS, install the Xcode Command Line Tools and CMake.
- On Windows x86-64, install the Visual Studio C++ Build Tools, CMake, LLVM, and NASM. If bindgen cannot find LLVM, set
LIBCLANG_PATHto the LLVMbindirectory.
Apple containers
Section titled “Apple containers”On Apple silicon, Apple’s container can run the same GHCR image. Start the runtime with container system start, then use container run --rm -p 127.0.0.1:8080:8080 ghcr.io/japka-org/japka:latest.
Native Windows
Section titled “Native Windows”Install the Windows build prerequisites and run cargo install --locked japka, or download the prebuilt Windows archive. In PowerShell, open the public site directory, validate the configuration, and start the server.
$env:DOCUMENT_ROOT = (Get-Location).Pathjapka config testif ($LASTEXITCODE -eq 0) { japka }Verify the page with curl.exe --fail http://127.0.0.1:8080/ from another terminal. Restart the process after changing its configuration.