Sitemap
Rakesh Sahu

Rakesh Sahu

Programmer 🧑‍💻, Photography Hobbyist 📸 From India 📸:Fujifilm X-E4 I code on weekdays and practice photography on weekends.

Why and How I self hosted Affine in my home server with Zima OS

4 min readOct 1, 2026

--

Press enter or click to view image in full size

In this artice I am going to explain why I choose Affine over Obsidian and Notion, also I will share you steps to install in your home server with docker compose file.

I already use my home server to run Immich for my photos. This time I wanted to try running my notes and workspace on the same server, instead of keeping everything in a cloud service.

AFFiNE caught my attention because it brings documents, tables, and a visual whiteboard into one workspace. In this article, I’ll show how I set it up on ZimaOS with Docker Compose, so you can try the same setup on your home server.

My Homer Server setup:
1. Lenovo ThinkStation mini pc.
2. Dual bay HDD enclosure for raid 1 system.
3. Wd Red plus SATA HDD 4tb x 2

Why I chose AFFiNE over Obsidian or Notion

I wanted a place where I could write notes, organize information, and sketch ideas without switching between separate apps. AFFiNE combines document editing, databases, and a freeform canvas in the same workspace. It can also be self-hosted, which lets me keep the server and its data on my own hardware. [AFFiNE’s self-host guide](https://docs.affine.pro/docs/self-host-affine) covers its Docker deployment.

Notion is polished and convenient, especially if you already use its cloud workspace and integrations. AFFiNE’s appeal for my home server is that I can run the service myself and keep the workspace on infrastructure I control. It also includes a visual canvas alongside its documents and tables.

Obsidian is excellent if you want a personal knowledge base built around local Markdown files, links, and community plugins. AFFiNE is a different fit: it combines documents with databases and a built-in visual workspace, and its self-hosted server can provide a shared workspace for multiple devices or people. Obsidian’s feature overview highlights its local files, offline use, and plugin ecosystem.

I would choose AFFiNE when I want documents and visual planning in one self-hosted workspace. If plain Markdown files or Obsidian’s plugin ecosystem are the main priority, Obsidian may fit better.

Press enter or click to view image in full size
my affine deployed on my server with zima os

What you need

  • A ZimaOS server that is already set up and reachable on your home network
    - Docker Compose support in ZimaOS
    - The AFFiNE Docker Compose file included with this article
    - A browser on a device connected to the same network

If you still need to install ZimaOS or set up your home server, see my guide to building a home server for Immich

Steps to install

  1. Login to your ZIMA server.
  2. Click on the plus(➕) icon to install a custom app.
  3. Download the yaml file form: this link.
  4. Replace “<YOUR_PATH>” to your desired path(❗important)
  5. Click “Import”, select docker compose and upload the yaml file.
  6. Verify all the fields and update the values are per your requirements.
  7. Now publish the app.
  8. Once published, click run and setup you admin account in local.

How to setup SMTP Service to get OTP?

You need to setup this if you want to use the desktop/mobile app instead of the web app.

Get Rakesh Sahu’s stories in your inbox

Join Medium for free to get updates from this writer.

Step 1 — Get a Gmail App Password

Since you’re on Gmail (most likely), go to myaccount.google.com → Security → 2-Step Verification → App passwords. Generate one for “Mail” and copy the 16-character password.

Step 2 — Configure SMTP in AFFiNE

Open https://affine.rakeshsahu.in/admin/settings (or http://<zima-ip>:3010/admin/settings) in your browser.
Go to Settings → Notification and fill in:

SMTP Host:smtp.gmail.com
SMTP Port465
Usernameyour-email@gmail.com
Password: the 16-char app password
Senderyour-email@gmail.com
Secure/TLStrue

Save it. Changes take effect immediately — no restart needed.

How to login to application?

2. Windows

  1. Download AFFiNE Desktop from affine.pro/download and install.
  2. Add your server in the workspace list panel in the top-left corner; you’ll be prompted to enter the address of your host, then log in. Affine
  3. Enter https://<your_custom_domain> (or http://<lan-ip>:3010 — the desktop client tolerates plain HTTP on LAN), sign in with the admin account, and create your first cloud workspace. Local-only workspaces stay on the PC; only workspaces created under the self-hosted server sync.

3. Android

  1. Install AFFiNE from the Play Store.
  2. Same flow: workspace switcher → add self-hosted server → enter the URL → log in.
  3. Use the HTTPS URL only. Users who set up the server per the docs on plain HTTP and then tried the Play Store app hit “Unable to connect to server” even though the same URL worked from the desktop app — the Android client won’t talk to cleartext HTTP. That’s the main reason to put NPM + your wildcard cert in front from day one. If you’re on the NetBird mesh, resolving <your_custom_domain> to the LAN/NetBird IP via Pi-hole keeps phone sync off the tunnel. GitHub

Accessing AFFiNE away from home

This guide covers access on the local network. If you want to reach a self-hosted service while away from home, I’ve described my remote access setup for Immich here: How I Access My Immich Photos From Anywhere.

Conclusion

AFFiNE gives me a self-hosted place for notes, documents, tables, and visual planning on the ZimaOS server I already use. The Compose setup makes it possible to run alongside other home-server apps, while keeping the workspace data on storage I control.

If you are looking for a self-hosted workspace that combines writing with a visual canvas, AFFiNE is worth trying. I’ll update this guide with the exact Compose configuration and screenshots from my setup.

PS: I have used the help of AI for this article, however all the steps are tested and verified by myself.😊

--

--

Written by Rakesh Sahu

Programmer 🧑‍💻, Photography Hobbyist 📸 From India 📸:Fujifilm X-E4 I code on weekdays and practice photography on weekends.