-
-
Notifications
You must be signed in to change notification settings - Fork 94
Installation
This guide covers all methods of installing and deploying CertMate.
- Python 3.9 or higher
- pip (Python package manager)
- Docker (optional, for containerized deployment)
git clone https://github.com/fabriziosalmi/certmate.git
cd certmatepython3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtCreate a .env file:
cp .env.example .env
# Edit .env with your settingspython app.pygit clone https://github.com/fabriziosalmi/certmate.git
cd certmate
docker-compose up -dgit clone https://github.com/fabriziosalmi/certmate.git
cd certmate
docker build -t certmate .
docker run -p 8000:8000 --env-file .env -v ./certificates:/app/certificates certmateFor advanced Docker deployment including multi-platform builds, see the Docker Guide.
sudo apt update
sudo apt install python3-dev python3-venv build-essential libssl-dev libffi-devsudo yum install python3-devel gcc openssl-devel libffi-develbrew install python3 openssl libffiAfter installation, configure your DNS provider credentials. See the DNS Providers Guide for detailed setup instructions for every supported provider.
Quick setup for common providers:
- Go to Cloudflare Dashboard
- Create a new API token with
Zone:DNS:Editpermissions - Add the token in CertMate Settings
- Create IAM user with Route53 permissions
- Generate access keys
- Add credentials in CertMate Settings
- Create a Service Principal
- Assign DNS Zone Contributor role
- Configure subscription details in CertMate Settings
- Create a Service Account with DNS Administrator role
- Download JSON key file
- Upload in CertMate Settings
# API Authentication (auto-generated if neither is set)
# Option A: inline value
API_BEARER_TOKEN=your_secure_token_here
# Option B: path to a file containing the token (takes precedence over API_BEARER_TOKEN)
API_BEARER_TOKEN_FILE=/run/secrets/api_bearer_token
# Flask session secret key (auto-generated if neither is set)
# Option A: inline value
SECRET_KEY=your_flask_secret_key
# Option B: path to a file containing the key (takes precedence over SECRET_KEY)
SECRET_KEY_FILE=/run/secrets/secret_key
# DNS Providers (choose one or multiple)
CLOUDFLARE_TOKEN=your_cloudflare_token
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AZURE_SUBSCRIPTION_ID=your_azure_subscription
AZURE_TENANT_ID=your_azure_tenant
AZURE_CLIENT_ID=your_azure_client
AZURE_CLIENT_SECRET=your_azure_secret
GOOGLE_PROJECT_ID=your_gcp_project
POWERDNS_API_URL=https://your-powerdns:8081
POWERDNS_API_KEY=your_powerdns_key| Variable | Precedence |
|---|---|
API_BEARER_TOKEN_FILE |
Highest — if set, API_BEARER_TOKEN is never read |
API_BEARER_TOKEN |
Used only when API_BEARER_TOKEN_FILE is absent |
| (generated) | Fallback when neither is set or the value fails validation |
SECRET_KEY_FILE |
Highest — if set, SECRET_KEY is never read |
SECRET_KEY |
Used only when SECRET_KEY_FILE is absent |
| (generated + persisted) | Written to data/.secret_key so sessions survive restarts |
Docker Secrets tip: Use
API_BEARER_TOKEN_FILE=/run/secrets/api_bearer_tokenandSECRET_KEY_FILE=/run/secrets/secret_keywith Docker Swarm or Kubernetes secrets to avoid putting sensitive values in environment variables.
gunicorn --bind 0.0.0.0:8000 --workers 4 app:appCreate /etc/systemd/system/certmate.service:
[Unit]
Description=CertMate SSL Certificate Manager
After=network.target
[Service]
Type=simple
User=certmate
WorkingDirectory=/opt/certmate
Environment=PATH=/opt/certmate/venv/bin
ExecStart=/opt/certmate/venv/bin/gunicorn --bind 0.0.0.0:8000 --workers 4 app:app
Restart=always
[Install]
WantedBy=multi-user.targetEnable and start:
sudo systemctl enable certmate
sudo systemctl start certmateversion: '3.8'
services:
certmate:
build: .
ports:
- "8000:8000"
environment:
- API_BEARER_TOKEN=${API_BEARER_TOKEN}
- CLOUDFLARE_TOKEN=${CLOUDFLARE_TOKEN}
volumes:
- ./certificates:/app/certificates
- ./data:/app/data
restart: unless-stoppedIf you encounter version conflicts, use these specific versions:
certbot==4.1.1
certbot-dns-cloudflare==4.1.1
certbot-dns-route53==4.1.1
certbot-dns-azure==2.6.1
certbot-dns-google==4.1.1
certbot-dns-powerdns==0.2.1Most DNS plugins require Certbot 4.1.1. The Azure plugin has independent versioning (2.6.1) and PowerDNS is a newer plugin (0.2.1).
If automatic installation fails, install DNS providers individually:
# Core certbot
pip install certbot==4.1.1
# Cloudflare
pip install certbot-dns-cloudflare==4.1.1
# AWS Route53
pip install certbot-dns-route53==4.1.1 boto3==1.35.76
# Azure DNS
pip install certbot-dns-azure==2.6.1 azure-identity==1.19.0 azure-mgmt-dns==8.1.0
# Google Cloud DNS
pip install certbot-dns-google==4.1.1 google-cloud-dns==0.35.0
# PowerDNS
pip install certbot-dns-powerdns==0.2.1# Check certbot plugins
certbot plugins --text
# Verify service is running
curl -X GET http://localhost:8000/api/healthIf you encounter issues:
- Check the logs for specific errors
- Verify your DNS provider credentials
- See the DNS Providers Guide for provider-specific troubleshooting
- See the Testing Guide for running diagnostics
CertMate · README · Releases · Report a bug · Request a feature
Getting started
Core configuration
Client certificates
Reference
Project