Deploy & Host WireMock | Railway

Deploy and Host WireMock on Railway

WireMock is a widely used tool for mocking HTTP APIs. You define stubs that match requests by URL, method, headers and body, and return canned or templated responses, delays and faults. Teams use it to test against third-party APIs that are slow, costly or unavailable, and to develop against APIs that do not exist yet.

About Hosting WireMock

This template deploys WireMock v3.13.2 from the official image as a single service. Mocked endpoints are served on your Railway domain, while the admin API under /__admin requires a generated username and password. Response templating is enabled globally. Stub mappings and response files live on a Railway volume, so stubs saved there survive redeploys. The JVM heap is capped at 384 MB, which fits the Hobby plan. Services in the same project can call the mock over the private network, for example from a staging environment. Stubs can also be edited as JSON files on the volume.

Common Use Cases

Dependencies for WireMock Hosting

Deployment Dependencies

Implementation Details

Service Image Networking Storage
wiremock wiremock/wiremock:3.13.2 public domain on 8080; private volume at /home/wiremock

Create a stub that is saved to the volume:

curl -u "admin:$WIREMOCK_ADMIN_PASSWORD" -X POST "https:///__admin/mappings" \
  -d '{"request": {"method": "GET", "url": "/users/1"},
       "response": {"status": 200, "jsonBody": {"id": 1, "name": "Ada"}},
       "persistent": true}'
Variable Default Purpose
WIREMOCK_ADMIN_USER / WIREMOCK_ADMIN_PASSWORD admin / generated Admin API login
JAVA_OPTS -Xmx384m JVM heap

Notes:

This is a community-maintained deployment package and does not imply affiliation with or endorsement by the WireMock project or its maintainers.

Why Deploy WireMock on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying WireMock on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.