Skip to content

Check your SEO health in minutes with my SEO by Daniel (me). Ensure correct on page Seo on your site Run a free audit →

Quick search

Installing Activepieces with docker compose and Traefik for self-hosted automation

Stop paying for Zapier. Deploy your Activepieces automation server using Docker and Traefik. Get the complete, production-ready config yaml here

Automation • • 5 min read
Installing Activepieces with docker compose and Traefik for self-hosted automation

I recently started playing with Activepieces to automate workflows across my services, and I was genuinely impressed by the software. It is a robust, open-source alternative to Zapier that you can host yourself.

In this guide, I will share my "production-ready" setup using Docker Compose and Traefik, ensuring a stable and performant installation.

Screenshot of the beginning of my 14 steps Analytics report that I use with my self-hosted Umami Analytics platform
Screenshot of the beginning of my 14 steps Analytics report that I use with my self-hosted Umami Analytics platform

What is Activepieces?

Activepieces is an open-source automation tool that enables you to create custom workflows across various apps and services. It provides the productivity of Zapier with the data control of self-hosting. It is designed for both developers and non-technical users who want to automate processes without writing custom code for every flow.

Want my expertize applied to you company? Contact me

Cloud vs. Self-Hosted: Why switch?

While the cloud version is great for getting started, self-hosting offers significant advantages for power users and privacy-conscious developers.

FeatureCloud VersionSelf-Hosted (Docker)CostSubscription basedFree (Your Infrastructure)Data PrivacyShared Environment100% Private ​ExecutionsMonthly LimitsUnlimited (Hardware dependent)SetupInstantRequires Docker & Traefik

Prerequisites

For this project, you need a server with:

  1. Docker & Docker Compose: The latest version of Docker Desktop or Engine comes with Compose pre-installed.
  2. Traefik: You need a working Traefik reverse proxy. If you haven't set one up yet, check my guide here: How I migrated to Ghost with Traefik.

Note on Hardware: Activepieces is lightweight, but for a smooth experience with multiple flows, ensure your VPS has at least 2GB of RAM.

You also need a working traefik installation and for that you can see the guide here https://danielpetrica.com/ghost-blog-migration-how-i-mov/ for a guide.

Do you have an opportunity to send me? Please feel free to send me an email

Send me a message

Step 1: The Environment Configuration

Most installation guides skip this, but it is crucial for security. Create a .env file in the same directory as your docker-compose.yaml. This file will store your sensitive database credentials.

# .env
# Database Credentials
AP_POSTGRES_DATABASE=activepieces
AP_POSTGRES_PASSWORD=CHANGEME_TO_SECURE_PASSWORD
AP_POSTGRES_USERNAME=postgres

# Execution Mode (Performance Tuning)
# Use "UNSANDBOXED" for maximum speed on private servers
# Use "SANDBOXED" if you plan to let others run untrusted code
AP_EXECUTION_MODE=UNSANDBOXED

# Secret Encryption Key (Generate a random string)
AP_ENCRYPTION_KEY=super_secret_key_change_this

# Your Domain (Optional, but good for reference)
DOMAIN_NAME=pieces.example.com

Step 2: The Docker Compose File

Here is the updated configuration for 2025. I have updated the image tag to latest to ensure you aren't stuck on the old version (0.17.0), and refined the Traefik labels for SSL automation.

File: docker-compose.yaml

services:
  activepieces:
    image: activepieces/activepieces:latest
    container_name: activepieces
    restart: unless-stopped
    depends_on:
      - postgres
      - redis
    env_file: .env
    networks:
      - activepieces
      - traefik
    # Performance tuning: Map timezone to ensure schedules run correctly
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    labels:
      - "traefik.enable=true"
      # Router Configuration
      - "traefik.http.routers.activepieces.rule=Host(`pieces.example.com`)"
      - "traefik.http.routers.activepieces.entrypoints=websecure"
      - "traefik.http.routers.activepieces.tls.certresolver=cloudflare"
      # Service Configuration
      - "traefik.http.services.activepieces.loadbalancer.server.port=80"

  postgres:
    image: postgres:14-alpine
    container_name: activepieces_postgres
    restart: unless-stopped
    environment:
      - POSTGRES_DB=${AP_POSTGRES_DATABASE}
      - POSTGRES_PASSWORD=${AP_POSTGRES_PASSWORD}
      - POSTGRES_USER=${AP_POSTGRES_USERNAME}
    volumes:
      - postgres_data:/var/lib/postgresql/data
    networks:
      - activepieces

  redis:
    image: redis:7-alpine
    container_name: activepieces_redis
    restart: unless-stopped
    volumes:
      - redis_data:/data
    networks:
      - activepieces

volumes:
  postgres_data:
  redis_data:

networks:
  activepieces:
  traefik:
    external: true

Important Configuration Notes

  • Version Tag: I used activepieces/activepieces:latest to ensure you get the newest features. For production environments, I recommend pinning this to a specific version (e.g., :0.72.0) once you are stable.
  • Traefik Labels: Replace pieces.example.com with your actual domain. Ensure your DNS records are pointing to your server.
  • Database Backup: Self-hosting means you are responsible for your data. I highly recommend adding a backup container. You can read my guide on that here: Easy Database Backups with Docker Compose.

Troubleshooting Common Issues

If your installation doesn't work immediately, check these common pitfalls:

  1. 502 Bad Gateway: This usually means Activepieces hasn't finished starting yet. Run docker logs activepieces to see if it's still migrating the database.
  2. Database Connection Errors: Ensure the variables in your .env file match the postgres service environment variables exactly.
  3. Traefik 404: Verify that the traefik network is defined as external: true and that your Traefik container is actually connected to that network.

Conclusion

Once operational, you can configure the software directly from the web interface. It allows you to replace paid SaaS subscriptions with your own performant, private automation server.

November 2025 update: I built a performant architecture capable of hosting any code and application. here is my article describing how I self host Laravel (custom application) with this stack read it to discover how you can improve your software: https://danielpetrica.com/a-production-ready-laravel-architecture-with-traefik-and-frankenphp/

Need help with your infrastructure?
Do you have a project in mind? Feel free to send me a message:
Send me a message

Related articles

More posts on similar topics you might enjoy.

All articles

Get my updates in your inbox

Register to be the first to receive my new articles on Laravel, DevOps, and more.

Subscribe to the newsletter

One email when new articles are published. No spam, unsubscribe anytime.

Protected by Mailcoach. Double opt-in may apply.