Welcome to the HASMCP Pro project setup guide for testing with your license key on localhost. This repository contains the configuration and control scripts (via a Makefile) to run HasMCP as a Docker container.
Before starting, ensure you have the following installed and configured on your host system:
- Docker: Make sure the Docker daemon is running.
- Make: The
makeutility to run commands in theMakefile. - License Key: A valid
license.keyfile for HASMCP Pro.
Follow these steps to set up and run your HASMCP instance:
Run the setup command to automatically create the necessary directory structure for certs, licenses, and storage:
make setupThis creates the following directories in the project root:
./_certs/: For SSL/TLS certificates../_license/: For storing your product license../_storage/: For application data persistence.
Copy your license.key file into the newly created ./_license/ directory:
cp /path/to/your/license.key ./_license/Important
The application will look specifically for ./_license/license.key to validate your HASMCP Pro installation.
Copy the template environment file to create your local configuration:
cp .env.example .envOpen the newly created .env file and customize the configuration variables.
Make sure to generate secure random keys for your secret tokens. You can generate secure hexadecimal keys using the following terminal commands:
- For 32-byte Hex Keys (e.g.,
HASMCP_APP_API_ACCESS_TOKEN,HASMCP_APP_ENCRYPTION_KEY):hexdump -vn32 -e'4/4 "%08X" 1 "\n"' /dev/urandom - For 16-byte Hex Keys (e.g.,
HASMCP_APP_HASH_SALT):hexdump -vn16 -e'4/4 "%08X" 1 "\n"' /dev/urandom
Once your .env is configured and your license.key is in place, you can start the application container using Docker.
To build, run, and start the HASMCP container with the loaded environment variables and mounted directories, run:
make restartTo update to the latest image tag and run the updated container:
make updateThe provided Makefile offers a full set of management commands:
| Command | Description |
|---|---|
make setup |
Creates ./_certs, ./_license, and ./_storage directories. |
make restart |
Restops, removes, and runs the Docker container with mounted volumes and ports 80/443. |
make update |
Stops the running container, prunes old images, pulls the latest image, and restarts. |
make up |
Starts the existing stopped container. |
make down |
Gracefully stops the running container. |
make logs |
Streams the container logs (docker logs -f hasmcp). |
make stats |
Displays resource usage stats for the container (docker stats hasmcp). |