Fluid Calendar
π Prerequisites
Before starting, ensure you have:
- Docker installed on your machine
- Portainer set up and running
- An available port for the app (default is
3000
, but we will use3087
in this guide) - An available port for PostgreSQL (default is
5432
, but we will use5433
for external access)
π Step 1: Prepare Your Environment
1οΈβ£ Create a Directory for Fluid Calendar
Since we need to persist the PostgreSQL database, create a directory:
mkdir -p /srv/Files/Fluidcalendar/postgres_dev_data
This will be used to store PostgreSQL data outside of the container.
π Step 2: Create the docker-compose.yml
File
1οΈβ£ Open Portainer and Create a New Stack
- Go to your Portainer dashboard
- Click on Stacks β Add a new stack
- Name it: fluid-calendar
- Copy and paste the following
docker-compose.yml
configuration:
services:
app:
image: eibrahim/fluid-calendar:latest
ports:
- "3087:3000" # External 3087 β Internal 3000
env_file:
- stack.env
depends_on:
db:
condition: service_healthy
restart: unless-stopped
db:
image: postgres:16-alpine
environment:
- POSTGRES_USER=fluid
- POSTGRES_PASSWORD=fluid
- POSTGRES_DB=fluid_calendar
ports:
- "5433:5432" # External 5433 β Internal 5432
volumes:
- /srv/Files/Fluidcalendar/postgres_dev_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U fluid -d fluid_calendar"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
π Step 3: Create the .env
File
1οΈβ£ Add an Environment File in Portainer
- Still in Portainer, scroll down to Environment Variables
- Click Add an Environment File
- Name it:
stack.env
- Paste the following content:
# Database Configuration
DATABASE_URL="postgresql://fluid:fluid@db:5432/fluid_calendar" # Internal Docker communication uses port 5432
# NextAuth Configuration
# Use domain in production, localhost for development
NEXTAUTH_URL="http://localhost:3087"
NEXT_PUBLIC_APP_URL="http://localhost:3087"
NEXTAUTH_SECRET="32charcomplicatedkey"
NEXT_PUBLIC_SITE_URL="http://localhost:3087"
NEXT_PUBLIC_ENABLE_SAAS_FEATURES=false
RESEND_API_KEY=
RESEND_FROM_EMAIL=
π Step 4: Deploy the Stack
- Click "Deploy the stack" in Portainer
- Wait for the services to start
- Open your browser and go to http://localhost:3087
β Step 5: Verify Everything is Running
1οΈβ£ Check Running Containers
In your terminal, run:
docker ps
You should see two running containers:
fluidcalendar_app_1
fluidcalendar_db_1
2οΈβ£ Check Logs for Errors
If something is wrong, check logs:
docker logs -f fluidcalendar-app-1
docker logs -f fluidcalendar-db-1
3οΈβ£ Test the Database Connection
If the app doesnβt connect, manually check the database:
docker exec -it fluidcalendar-db-1 psql -U fluid -d fluid_calendar
If it works, the database is running fine.
π Step 6: Connect Fluid Calendar to Nextcloud
To sync your Nextcloud calendar with Fluid Calendar, use the following details:
- Username: Your Nextcloud username
- Password: An app-specific password (Generate one in Nextcloud under Settings β Security)
- Server URL:
https://cloud.example.com
(Replace with your Nextcloud instance) - Path:
/remote.php/dav
π Troubleshooting
β App stuck at "Waiting for database to be ready..."
- Check that the database container is running:
docker ps | grep fluidcalendar-db
- Ensure you are using port
5432
inside Docker:
Run this inside the app container:
If this works, updatedocker exec -it fluidcalendar-app-1 sh psql "postgresql://fluid:fluid@db:5432/fluid_calendar"
.env
to use5432
, not5433
.
β Database Not Persisting
Make sure the volume is mounted correctly:
ls -la /srv/Files/Fluidcalendar/postgres_dev_data
If the folder is empty, check that Docker has write permissions.
π Conclusion
That's it! You have successfully deployed Fluid Calendar on Portainer with Docker. π
If you run into any issues, check the logs and verify the database connection. Hope this helps! π
No Comments