Self-Hosting UGC Guard with Docker
Deploying UGC Guard using Docker is straightforward and efficient.
Prerequisites
- A macOS or linux machine. UGC Guard might work on Windows, but we have not tested it.
- Docker or a compatible alternative like Podman.
- Sufficient disk space, memory, and a bit of time
- An SMTP service (for local development, MailSlurper is sufficient)
Getting Started
First, clone the UGC Guard repository from GitHub:
git clone https://github.com/SD-Software-Design-GmbH/ugc-guard.gitNext, set up your environment variables:
cp /api/.example.env /api/.envLocal Development Setup
For local testing, you only need to configure your SMTP server. Refer to the configuration guide for detailed instructions.
Production Hosting Setup
To host UGC Guard on your own server, configure both the backend and frontend:
Domain Setup:
Decide on your domains. For example, we usereports.example.comfor the frontend andapi.reports.example.comfor the API. Configure these domains with your provider.Backend Configuration:
Edit the following fields in/api/.env:yamlfrontend_url: "https://reports.example.com" api_url: "https://api.reports.example.com" secret_key: "Generate a secret key and paste it here" # openssl rand -hex 32SMTP Configuration:
Set up your SMTP server as described in the configuration guide.Frontend Configuration:
Update/app/ugc-guard/.env:tomlVITE_UGC_GUARD_BACKEND_URL=https://api.reports.example.com
Once these steps are complete, you’re ready to launch the service.
Starting UGC Guard
To start all services, run:
docker compose upTo run in detached mode:
docker compose up -dBy default, the services will be available at:
API: http://localhost:8099
Frontend: http://localhost:5173Production Reverse Proxy
For production, use a reverse proxy like Caddy. Example configuration:
reports.example.com {
reverse_proxy localhost:5173
}
api.reports.example.com {
reverse_proxy localhost:8099
}Stopping UGC Guard
To stop the services:
docker compose downHosting the Documentation
If you wish to host the documentation, it will be available on port 5174.