
My booking page now lives at cal.parthans.com. It runs on my own server, in my own database, and it talks to my Outlook calendar, Teams, Zoom and Google Calendar. It took two days. Twelve things broke on the way, and I wrote each one down, because the fixes are the useful part.
Why bother
I wanted a booking system I fully own. The kind that lives as long as parthans.com does, sits next to my other systems, and can grow into something bigger later. Hosted schedulers are fine. They are also rented, and they do not play with the rest of my stack.
Cal.diy is the open fork of Cal.com. Self-hosting it means a Next.js monorepo, a Postgres database, email, and a developer app for every calendar and video service you want to connect. That last part is where most of my time went.
What I built it on
Piece | What I used |
|---|---|
Server | A small VPS (2 CPUs, 7.8 GB RAM) managed with FlyWP, shared with my other sites |
App | Cal.diy, built with Yarn 4 and Turborepo |
Database | Postgres 16 in its own container, on the site's Docker network |
Amazon SES, SMTP, region ap-south-1 | |
Calendars and video | Microsoft (Outlook and Teams), Zoom, Google Calendar |
One working note. I did this with Claude Code in the loop, and the rule was simple: Claude has no access to my server. It read the Cal.diy source to confirm which environment variables and redirect URLs each integration expects. I ran every command myself and pasted back the output. That split caught a few mistakes early, and it kept me honest about what I was actually executing.
The process, in order
Get the app building. Deploy script, Yarn instead of npm, build by hand first.
Give it a database. A Postgres container, then run the migrations.
Make it start. A one-line fix for how FlyWP checks the build.
Get email working. SES SMTP credentials, one duplicate line.
Lock it down. Signup off, secrets rotated, two-factor on.
Connect calendars and video. Three developer apps, one callback at a time.
Clean up. Rotate what leaked into chat, delete the backups, test a normal deploy.
The 12 things that broke
1. The build died on workspace:. The default FlyWP script runs npm install. Cal.diy is a Yarn 4 monorepo, and npm cannot read workspace:* dependencies. The error was EUNSUPPORTEDPROTOCOL. Fix: enable Corepack and run yarn install --immutable and yarn build --concurrency=1.
2. The build could not reach the database. Prisma wanted cal-postgres while the build container sat on the default network. Fix: run the build container with --network cal.parthans.com, the site's own Docker network.
3. FlyWP stopped the deploy at 30 minutes. The build was slow on a shared 2-CPU box and the platform gives a deploy half an hour. The symptom was exit code 129 at "Running TypeScript". Fix: run the first build by hand over SSH. Turborepo caches the result, so the FlyWP deploy that follows is mostly cache hits and finishes in a few minutes.
4. The container looped on "Build output not found". FlyWP's start check looks for /app/.next/BUILD_ID. Cal builds into apps/web/.next. Editing the compose file does not help, because FlyWP rewrites it on every deploy. Fix: a symlink, ln -s apps/web/.next .next, inside the app folder.
5. The app store seed script ignored my .env. It tried 127.0.0.1:5432, then failed on a hostname. Passing the file with docker --env-file keeps the quotes around DATABASE_URL. What worked: load the file inside the container with set -a; . /app/.env; set +a and then run the seed.
6. Booking emails failed on a hostname that did not exist. My .env had two EMAIL_SERVER_HOST lines. A placeholder sat below the real one and won. Fix: delete the duplicate.
7. SES said 535 Authentication Credentials Invalid. I had reused the IAM secret from another project. SES SMTP needs its own SMTP password, which is derived from the IAM secret and is a different string. Fix: generate SMTP credentials for the right region.
8. A plain docker restart did not pick up .env changes. Use docker compose up -d --no-deps --force-recreate node instead.
9. The signup flag was in .env and the build ignored it. This one cost the most. I set NEXT_PUBLIC_DISABLE_SIGNUP=true, rebuilt, and the build finished in 52 seconds. A build that should take about fifteen minutes had come straight from the Turborepo cache. Turbo evidently does not hash that variable, so as far as it could tell nothing had changed, and it replayed the old output with signup still open. The log said cache hit for the web task, and that line was the whole clue. Fix: yarn build --concurrency=1 --force, about seven minutes. After that /signup said "Signup is disabled in this instance".
10. Microsoft returned three different errors for one app.
AADSTS700016 Application not found in the directory, twice. First I had typed the client secret into the client ID field. Then I had copied the Directory (tenant) ID, which is a GUID too, and looks just like the Application (client) ID. The Overview page shows both side by side.AADSTS7000215 Invalid client secret. Azure shows a Secret ID and a Secret Value. Cal needs the Value, which is shown once at creation.
The error text named the cause every time. I only had to read it slowly.
11. Cal's calendar callback fails silently. Nothing was logged on the server. A failed OAuth callback just redirects back to Cal with ?error= in the address bar. The log was empty and the URL had the whole answer, including the Microsoft error code.
12. Google Meet failed on a test booking. Meet links come from creating an event on your Google Calendar, and my destination calendar was Outlook. I did not need Meet, since Teams and Zoom cover video, so I removed it and moved on. Not every error deserves a fix.
Connecting the calendars
Cal copies app keys from .env into its database when you run the seed. So each integration is the same loop: create the developer app, put two values in .env, run the seed, recreate the container, then click Install in Cal.
Microsoft (Outlook calendar and Teams, one shared app). In Azure, register an app. Set supported account types to any organisation plus personal accounts, because Cal uses the common login endpoint and a single-tenant app fails there. Add two redirect URLs under your domain: /api/integrations/office365calendar/callback and /api/integrations/office365video/callback. Add delegated Graph permissions: User.Read, Calendars.Read, Calendars.ReadWrite, OnlineMeetings.ReadWrite and offline_access. Then create a client secret and copy its Value.
Zoom. Create a General App in the Zoom Marketplace, user-managed, and leave it unpublished. Set the redirect URL to /api/integrations/zoomvideo/callback, add the meeting scopes, and copy the client ID and secret.
Google Calendar. Enable the Calendar API, set up the OAuth consent screen with yourself as a test user, then create an OAuth client of type Web application. In the new console, choose User data when it asks what data you are accessing, so you get an OAuth client and not a service account.
Google keeps apps in Testing mode on a short leash: refresh tokens expire after seven days. Publishing a personal app to production avoids that.
I entered every key through a hidden prompt on the server, so none of them touched the chat:
read -rsp "Client secret: " S && echo \
&& sed -i '/^MS_GRAPH_CLIENT_SECRET=/d' .env \
&& printf 'MS_GRAPH_CLIENT_SECRET=%s\n' "$S" >> .env && unset S
Then the seed and the reload:
docker exec calparthanscom-node-1 sh -c 'cd /app && set -a && . /app/.env && set +a && yarn workspace @calcom/prisma seed-app-store'
docker compose -f /home/fly/cal.parthans.com/docker-compose.yml up -d --no-deps --force-recreate node
What I would tell anyone doing this
Assume nothing, including a green build. A build that finishes is not a build that contains your change. When a fifteen minute job takes 52 seconds, the speed is the finding. Look for cache hit.
Read the error before touching anything. Microsoft's messages said which value was wrong, three times. Cal's callback hid its error in the address bar. Know where each tool puts its failure.
Separate build time from run time. Anything starting with NEXT_PUBLIC_ is baked into the build. Changing it needs a forced rebuild. Everything else needs only a container recreate. I rotated my VAPID keys late and had to rebuild for the public one.
Check secrets without printing them. I compared each .env line with a backup and printed SAME or CHANGED. I used grep -c to confirm a key existed. Once a value is in a chat window it is spent, so I rotated everything that had been pasted there, including the database password.
Do the slow thing by hand once. A manual build over SSH filled the cache. The platform deploy that followed was done in a few minutes.
Prune with facts. I was ready to run docker system prune to free disk. docker system df showed Docker using about 6 GB, with nothing reclaimable. The disk was fine and the big folder was an old WordPress copy. Measure first.
Drop what you do not need. Google Meet was not worth another hour. Teams and Zoom cover video.
Where it stands
Signup is off, two-factor is on, secrets and the database password are rotated, and a normal FlyWP deploy passes. Outlook, Teams, Zoom and Google Calendar are connected. Next on my list is wiring the booking data into my other systems, which was the point of owning this in the first place.
If you try this and hit an error that is not here, send it to me.
If you want to speak to me, pick a time on my new calendar: cal.parthans.com/pns and add this blog post as a reference!


