Deployment Options
- Hosted: use
https://crafatar.euphoriadevelopment.ukdirectly. - Self-hosted: deploy with Docker, Docker Compose, Pterodactyl Panel, or Node.js + Redis.
For endpoint and parameter reference, use Crafatar API Docs.
https://crafatar.euphoriadevelopment.uk directly.For endpoint and parameter reference, use Crafatar API Docs.
Fast single-host deployment with a dedicated Redis container.
docker network create crafatar
docker run --net crafatar -d --name redis redis:7-alpine
docker run --net crafatar \
-v crafatar-images:/home/app/crafatar/images \
-e CACHE_BACKEND=redis \
-e REDIS_URL=redis://redis:6379 \
-e BIND=0.0.0.0 \
-e PORT=3000 \
-e EXTERNAL_URL=https://crafatar.example.com \
-p 3000:3000 \
docker.io/repgraphics/crafatar:latest
Service is then available at http://0.0.0.0:3000 behind your proxy/domain.
Uses the repo's maintained docker-compose.yml with Redis health checks and persistent volumes.
git clone https://github.com/EuphoriaTheme/crafatar.git
cd crafatar
cp .env.example .env
docker compose up -d
docker compose logs -f crafatar
Windows PowerShell quick start:
Copy-Item .env.example .env
docker compose up -d
The compose stack binds Crafatar to 3000:3000, mounts crafatar-images, and stores Redis data in redis-data.
Use the official egg from your repository: pterodactyl egg/egg-crafatar.json.
egg-crafatar.json into a nest.docker.io/repgraphics/crafatar:latest.BIND=0.0.0.0 and configure EXTERNAL_URL to your public domain.CACHE_BACKEND=redis and REDIS_URL=redis://host:6379. If you do not run Redis, set CACHE_BACKEND=memory.Server running on http://.CACHE_BACKEND=redis
REDIS_URL=redis://redis.example.internal:6379
BIND=0.0.0.0
EXTERNAL_URL=https://crafatar.example.com
SOURCE_REPO=EuphoriaTheme/crafatar
SOURCE_REF=master
git clone https://github.com/EuphoriaTheme/crafatar.git
cd crafatar
npm install
cp .env.example .env
npm start
If node-canvas fails to build, install system dependencies from the official node-canvas installation guide.
Set these in .env:
CACHE_BACKEND=redis, memory, or none (default is redis in .env.example).REDIS_URL=redis://host:6379 (or rediss:// for TLS) when CACHE_BACKEND=redis.PORT=3000, BIND=0.0.0.0.EXTERNAL_URL=https://crafatar.example.com for canonical public URL in docs/examples.CACHE_LOCAL=1200 and CACHE_BROWSER=3600 control freshness and browser cache lifetime.RETENTION_ENABLED=true, RETENTION_DAYS=30, RETENTION_INTERVAL_HOURS=24 for cleanup.REDIS_URL must use redis:// or rediss://. Invalid protocol disables Redis caching at startup.
server {
listen 443 ssl http2;
server_name crafatar.example.com;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Crafatar reads forwarded headers to build correct external URLs when EXTERNAL_URL is not set.
curl -I "http://127.0.0.1:3000/avatars/069a79f444e94726a5befca90e38aaf5?size=64"
curl -I "http://127.0.0.1:3000/renders/head/069a79f444e94726a5befca90e38aaf5?scale=4"
200 and image/png for valid requests.422 for invalid UUID/size/scale/default values.CACHE_LOCAL or clear image cache/Redis keys.