Installation
Install moclojer in minutes with Docker, JAR, or native binary. Step-by-step guide with verification steps and troubleshooting. Get your mock server running on Linux, macOS, or Windows.
Get moclojer running on your system in just a few minutes. Choose the installation method that works best for your setup.
Quick Start (Recommended)
The fastest way to try moclojer is with Docker:
docker run -it -p 8000:8000 ghcr.io/moclojer/moclojer:latestThis will start moclojer on port 8000 with a default configuration. You can now test it by visiting http://localhost:8000 in your browser.
Installation Methods
🐳 Docker (Recommended)
Docker is the easiest way to get started, especially for trying moclojer or using it in development.
Requirements:
Docker installed on your system
Basic usage:
# Run with default configuration
docker run -it -p 8000:8000 ghcr.io/moclojer/moclojer:latest
# Run with your own configuration file
docker run -it \
-p 8000:8000 \
-v $(pwd)/moclojer.yml:/app/moclojer.yml \
ghcr.io/moclojer/moclojer:latestAvailable Docker tags:
latest- Latest stable releasedev- Latest development version from main branch
Custom port:
📚 For production deployments: See the complete Docker Deployment Guide for Docker Compose, multi-environment setup, and CI/CD integration.
☕ Standalone JAR
The JAR file works on any system with Java installed. Perfect for CI/CD, scripts, or when you don't want to use Docker.
Requirements:
Java 11 or higher
Download and run:
Quick installation script:
Note: On Linux, you might need
sudofor the installation script.
📦 Native Binary (Linux)
For Linux systems, we provide a native binary that doesn't require Java.
Download:
Usage:
🔧 From Source (Clojure)
If you're a Clojure developer or want to contribute to moclojer.
Requirements:
Clojure CLI tools installed
Git
Clone and run:
Build your own JAR:
Verification
After installation, verify that moclojer is working:
Create a simple configuration file named
moclojer.yml:
Start moclojer with your configuration:
Test the endpoint:
You should see:
Configuration
By default, moclojer looks for configuration files in these locations:
./moclojer.yml(current directory)~/.config/moclojer.yml(user config directory)/etc/moclojer.yml(system config)
You can specify a custom configuration file with the --config option:
Environment Variables
Configure moclojer using environment variables:
PORT
Server port
8000
CONFIG
Configuration file path
~/.config/moclojer.yml
MOCKS
Mocks file path (alternative to CONFIG)
-
SENTRY_DSN
Sentry DSN for error reporting
-
Example:
Command Line Options
-c, --config PATH
Configuration file path
-m, --mocks PATH
OpenAPI v3 mocks file path
-f, --format FORMAT
Output format (println or json)
-h, --help
Show help information
-v, --version
Show version information
📚 For all CLI options: See the complete CLI Reference with detailed examples and use cases.
Troubleshooting
Port already in use
If port 8000 is already in use:
Java not found
Make sure Java 11+ is installed:
Configuration file not found
Ensure your configuration file exists and is readable:
Docker permission denied
On Linux, you might need to add your user to the docker group:
📚 More issues? Check the complete Troubleshooting Guide with solutions for 20+ common problems.
Next Steps
Now that moclojer is installed, let's create your first mock server:
Need Help?
FAQ - Common installation issues
Troubleshooting Guide - Detailed solutions for common problems
GitHub Issues - Report bugs or get help
GitHub Discussions - Community support
See Also
Docker Deployment Guide - Production-ready Docker setup
CLI Reference - Complete command-line options reference
Configuration Formats - YAML, OpenAPI, and Postman formats
Last updated
Was this helpful?