[{"data":1,"prerenderedAt":777},["ShallowReactive",2],{"docs-nav":3,"content-query-S43mdH9sUR":249},[4,8,11,14,18,22,26,30,34,38,42,46,50,54,58,62,66,70,74,78,82,86,90,94,98,102,105,108,111,114,117,120,123,126,129,132,135,138,141,144,147,150,153,156,159,162,165,168,171,174,177,180,183,186,189,192,195,198,201,204,207,210,213,216,219,222,225,228,231,234,237,240,243,246],{"_path":5,"title":6,"order":7},"/docs/getting-started","Getting Started",1,{"_path":9,"title":10,"order":7},"/docs/self-hosting/all-in-one","All-in-One Setup",{"_path":12,"title":13,"order":7},"/docs/views/grid","Grid View",{"_path":15,"title":16,"order":17},"/docs/core-concepts","Core Concepts",10,{"_path":19,"title":20,"order":21},"/docs/crdt","What is a CRDT?",11,{"_path":23,"title":24,"order":25},"/docs/self-hosting/separate-containers","Separate Containers Setup",2,{"_path":27,"title":28,"order":29},"/docs/interface-overview","Interface Overview",20,{"_path":31,"title":32,"order":33},"/docs/global-search","Global Search",22,{"_path":35,"title":36,"order":37},"/docs/filters","Filters",24,{"_path":39,"title":40,"order":41},"/docs/sorting","Sorting",25,{"_path":43,"title":44,"order":45},"/docs/tagging-and-selection","Tagging & Selection",26,{"_path":47,"title":48,"order":49},"/docs/quick-view","Quick View",28,{"_path":51,"title":52,"order":53},"/docs/self-hosting/remote-access-tailscale","Remote Access with Tailscale",3,{"_path":55,"title":56,"order":57},"/docs/block-actions","Block Actions",30,{"_path":59,"title":60,"order":61},"/docs/deleting-blocks","Deleting Blocks & Trash",32,{"_path":63,"title":64,"order":65},"/docs/self-hosting","Self-Hosting",4,{"_path":67,"title":68,"order":69},"/docs/managing-heaps","Managing Heaps",40,{"_path":71,"title":72,"order":73},"/docs/file-scanning","File Scanning & Importing",42,{"_path":75,"title":76,"order":77},"/docs/storage-management","Storage Management",44,{"_path":79,"title":80,"order":81},"/docs/daily-notes","Daily Notes & Calendar",46,{"_path":83,"title":84,"order":85},"/docs/views","Views",60,{"_path":87,"title":88,"order":89},"/docs/authentication","Authentication & User Management",70,{"_path":91,"title":92,"order":93},"/docs/licenses-privacy","Licenses & Privacy",72,{"_path":95,"title":96,"order":97},"/docs/faq","FAQ",80,{"_path":99,"title":100,"order":101},"/docs/changelog","Changelog",99,{"_path":103,"title":104},"/docs/changelog/v16.16.15","v16.16.15",{"_path":106,"title":107},"/docs/changelog/v16.16.34","v16.16.34",{"_path":109,"title":110},"/docs/changelog/v16.16.28","v16.16.28",{"_path":112,"title":113},"/docs/changelog/v16.16.35","v16.16.35",{"_path":115,"title":116},"/docs/changelog/v16.16.32","v16.16.32",{"_path":118,"title":119},"/docs/changelog/v16.8.0","v16.8.0",{"_path":121,"title":122},"/docs/changelog/v16.16.8","v16.16.8",{"_path":124,"title":125},"/docs/changelog/v16.16.27","v16.16.27",{"_path":127,"title":128},"/docs/changelog/v16.16.41","v16.16.41",{"_path":130,"title":131},"/docs/changelog/v16.16.11","v16.16.11",{"_path":133,"title":134},"/docs/changelog/v16.16.14","v16.16.14",{"_path":136,"title":137},"/docs/changelog/v16.16.17","v16.16.17",{"_path":139,"title":140},"/docs/changelog/v16.16.10","v16.16.10",{"_path":142,"title":143},"/docs/changelog/v16.16.20","v16.16.20",{"_path":145,"title":146},"/docs/changelog/v16.6.0","v16.6.0",{"_path":148,"title":149},"/docs/changelog/v16.16.22","v16.16.22",{"_path":151,"title":152},"/docs/changelog/v16.16.6","v16.16.6",{"_path":154,"title":155},"/docs/changelog/v16.16.36","v16.16.36",{"_path":157,"title":158},"/docs/changelog/v16.16.18","v16.16.18",{"_path":160,"title":161},"/docs/changelog/v16.16.38","v16.16.38",{"_path":163,"title":164},"/docs/changelog/v16.16.1","v16.16.1",{"_path":166,"title":167},"/docs/changelog/v16.16.12","v16.16.12",{"_path":169,"title":170},"/docs/changelog/v16.16.31","v16.16.31",{"_path":172,"title":173},"/docs/changelog/v16.16.40","v16.16.40",{"_path":175,"title":176},"/docs/changelog/v16.7.0","v16.7.0",{"_path":178,"title":179},"/docs/changelog/v16.9.0","v16.9.0",{"_path":181,"title":182},"/docs/changelog/v16.16.4","v16.16.4",{"_path":184,"title":185},"/docs/changelog/v16.16.13","v16.16.13",{"_path":187,"title":188},"/docs/changelog/v16.16.37","v16.16.37",{"_path":190,"title":191},"/docs/changelog/v16.16.9","v16.16.9",{"_path":193,"title":194},"/docs/changelog/v16.16.25","v16.16.25",{"_path":196,"title":197},"/docs/changelog/v16.16.24","v16.16.24",{"_path":199,"title":200},"/docs/changelog/v16.16.3","v16.16.3",{"_path":202,"title":203},"/docs/changelog/v16.10.0","v16.10.0",{"_path":205,"title":206},"/docs/changelog/v16.16.16","v16.16.16",{"_path":208,"title":209},"/docs/changelog/v16.16.33","v16.16.33",{"_path":211,"title":212},"/docs/changelog/v16.16.26","v16.16.26",{"_path":214,"title":215},"/docs/changelog/v16.16.43","v16.16.43",{"_path":217,"title":218},"/docs/changelog/v16.11.0","v16.11.0",{"_path":220,"title":221},"/docs/changelog/v16.16.29","v16.16.29",{"_path":223,"title":224},"/docs/changelog/v16.16.5","v16.16.5",{"_path":226,"title":227},"/docs/changelog/v16.16.39","v16.16.39",{"_path":229,"title":230},"/docs/changelog/v16.16.2","v16.16.2",{"_path":232,"title":233},"/docs/changelog/v16.16.7","v16.16.7",{"_path":235,"title":236},"/docs/changelog/v16.16.23","v16.16.23",{"_path":238,"title":239},"/docs/changelog/v16.16.0","v16.16.0",{"_path":241,"title":242},"/docs/changelog/v16.16.30","v16.16.30",{"_path":244,"title":245},"/docs/changelog/v16.16.21","v16.16.21",{"_path":247,"title":248},"/docs/changelog/v16.16.19","v16.16.19",{"_path":23,"_dir":250,"_draft":251,"_partial":251,"_locale":252,"title":24,"description":253,"order":25,"body":254,"_type":771,"_id":772,"_source":773,"_file":774,"_stem":775,"_extension":776},"self-hosting",false,"","Self-host heaper with separate PostgreSQL and application containers",{"type":255,"children":256,"toc":761},"root",[257,265,271,285,292,304,335,361,366,377,395,401,410,416,423,520,526,695,701,723,729],{"type":258,"tag":259,"props":260,"children":262},"element","h1",{"id":261},"separate-containers-setup",[263],{"type":264,"value":24},"text",{"type":258,"tag":266,"props":267,"children":268},"p",{},[269],{"type":264,"value":270},"For more control over your database — e.g. using an existing Postgres instance, custom tuning, or separate scaling — run PostgreSQL and heaper as separate containers.",{"type":258,"tag":266,"props":272,"children":273},{},[274,276,283],{"type":264,"value":275},"This setup uses ",{"type":258,"tag":277,"props":278,"children":280},"code",{"className":279},[],[281],{"type":264,"value":282},"ghcr.io/janlunge/heaper-postgres:latest",{"type":264,"value":284}," which includes the ULID extension required by heaper.",{"type":258,"tag":286,"props":287,"children":289},"h2",{"id":288},"docker-compose",[290],{"type":264,"value":291},"Docker Compose",{"type":258,"tag":293,"props":294,"children":299},"pre",{"className":295,"code":297,"language":298,"meta":252},[296],"language-yaml","services:\n  postgres:\n    image: ghcr.io/janlunge/heaper-postgres:latest\n    platform: linux/amd64   # Required on ARM devices\n    container_name: heaper-selfhost-postgres\n    restart: unless-stopped\n    environment:\n      - POSTGRES_USER=heaper\n      - POSTGRES_PASSWORD=change-me-please\n      - POSTGRES_DB=heaper\n    volumes:\n      - ./heaper-data/postgres:/var/lib/postgresql/data\n    # Uncomment to expose PostgreSQL externally:\n    # ports:\n    #   - \"5432:5432\"\n\n  heaper:\n    image: ghcr.io/janlunge/heaper:latest\n    platform: linux/amd64   # Required on ARM devices\n    container_name: heaper-selfhost\n    restart: unless-stopped\n    mem_limit: 4g\n    memswap_limit: 4g\n    depends_on:\n      - postgres\n    ports:\n      - \"3010:80\"\n    environment:\n      - HOSTNAME=localhost\n      - ENABLE_INTERNAL_POSTGRES=false\n      - DB_HOST=postgres:5432\n      - DB_USER=heaper\n      - DB_PASS=change-me-please\n      - DB_NAME=heaper\n    volumes:\n      - ./heaper-data/config:/usr/src/app/config\n      - ./heaper-data/data:/usr/src/app/data\n      - ./heaper-data/thumbnails:/mnt/thumbnails\n      - ./heaper-data/storage:/mnt/storage\n      - ./heaper-data/backups:/mnt/backups\n","yaml",[300],{"type":258,"tag":277,"props":301,"children":302},{"__ignoreMap":252},[303],{"type":264,"value":297},{"type":258,"tag":305,"props":306,"children":307},"blockquote",{},[308],{"type":258,"tag":266,"props":309,"children":310},{},[311,317,319,325,327,333],{"type":258,"tag":312,"props":313,"children":314},"strong",{},[315],{"type":264,"value":316},"Info:",{"type":264,"value":318}," When using Podman instead of Docker, the Postgres volume (",{"type":258,"tag":277,"props":320,"children":322},{"className":321},[],[323],{"type":264,"value":324},"/var/lib/postgresql/data",{"type":264,"value":326},") cannot be bind-mounted to a host path — Postgres requires specific permissions that Podman does not allow for bind mounts. Use a named volume (e.g. ",{"type":258,"tag":277,"props":328,"children":330},{"className":329},[],[331],{"type":264,"value":332},"postgres_data:/var/lib/postgresql/data",{"type":264,"value":334},") instead.",{"type":258,"tag":266,"props":336,"children":337},{},[338,343,345,351,353,359],{"type":258,"tag":312,"props":339,"children":340},{},[341],{"type":264,"value":342},"Before first run:",{"type":264,"value":344}," Change ",{"type":258,"tag":277,"props":346,"children":348},{"className":347},[],[349],{"type":264,"value":350},"POSTGRES_PASSWORD",{"type":264,"value":352}," and ",{"type":258,"tag":277,"props":354,"children":356},{"className":355},[],[357],{"type":264,"value":358},"DB_PASS",{"type":264,"value":360}," to the same secure password.",{"type":258,"tag":266,"props":362,"children":363},{},[364],{"type":264,"value":365},"Start it:",{"type":258,"tag":293,"props":367,"children":372},{"className":368,"code":370,"language":371,"meta":252},[369],"language-bash","docker-compose up -d\n","bash",[373],{"type":258,"tag":277,"props":374,"children":375},{"__ignoreMap":252},[376],{"type":264,"value":370},{"type":258,"tag":266,"props":378,"children":379},{},[380,385,387],{"type":258,"tag":312,"props":381,"children":382},{},[383],{"type":264,"value":384},"Access:",{"type":264,"value":386}," ",{"type":258,"tag":388,"props":389,"children":393},"a",{"href":390,"rel":391},"http://localhost:3010",[392],"nofollow",[394],{"type":264,"value":390},{"type":258,"tag":286,"props":396,"children":398},{"id":397},"docker-run",[399],{"type":264,"value":400},"Docker Run",{"type":258,"tag":293,"props":402,"children":405},{"className":403,"code":404,"language":371,"meta":252},[369],"# Create network\ndocker network create heaper\n\n# Run PostgreSQL\ndocker run -d --name heaper-selfhost-postgres --platform linux/amd64 \\\n  -e POSTGRES_USER=heaper \\\n  -e POSTGRES_PASSWORD=YOURPASSWORD \\\n  -e POSTGRES_DB=heaper \\\n  -p \"5432:5432\" \\\n  --volume /path/to/heaper/postgres:/var/lib/postgresql/data \\\n  --network heaper \\\n  ghcr.io/janlunge/heaper-postgres:latest\n\n# Run Heaper\ndocker run -d --name heaper-selfhost --platform linux/amd64 \\\n  -p 3010:80 \\\n  -e HOSTNAME=your-domain.com \\\n  -e ENABLE_INTERNAL_POSTGRES=false \\\n  -e DB_HOST=heaper-selfhost-postgres:5432 \\\n  -e DB_USER=heaper \\\n  -e DB_PASS=YOURPASSWORD \\\n  -e DB_NAME=heaper \\\n  --volume /path/to/heaper/config:/usr/src/app/config \\\n  --volume /path/to/heaper/thumbnails:/mnt/thumbnails \\\n  --volume /path/to/heaper/storage:/mnt/storage \\\n  --network heaper \\\n  ghcr.io/janlunge/heaper:latest\n",[406],{"type":258,"tag":277,"props":407,"children":408},{"__ignoreMap":252},[409],{"type":264,"value":404},{"type":258,"tag":286,"props":411,"children":413},{"id":412},"environment-variables",[414],{"type":264,"value":415},"Environment Variables",{"type":258,"tag":417,"props":418,"children":420},"h3",{"id":419},"postgresql-container",[421],{"type":264,"value":422},"PostgreSQL Container",{"type":258,"tag":424,"props":425,"children":426},"table",{},[427,451],{"type":258,"tag":428,"props":429,"children":430},"thead",{},[431],{"type":258,"tag":432,"props":433,"children":434},"tr",{},[435,441,446],{"type":258,"tag":436,"props":437,"children":438},"th",{},[439],{"type":264,"value":440},"Variable",{"type":258,"tag":436,"props":442,"children":443},{},[444],{"type":264,"value":445},"Default",{"type":258,"tag":436,"props":447,"children":448},{},[449],{"type":264,"value":450},"Description",{"type":258,"tag":452,"props":453,"children":454},"tbody",{},[455,478,499],{"type":258,"tag":432,"props":456,"children":457},{},[458,468,473],{"type":258,"tag":459,"props":460,"children":461},"td",{},[462],{"type":258,"tag":277,"props":463,"children":465},{"className":464},[],[466],{"type":264,"value":467},"POSTGRES_USER",{"type":258,"tag":459,"props":469,"children":470},{},[471],{"type":264,"value":472},"heaper",{"type":258,"tag":459,"props":474,"children":475},{},[476],{"type":264,"value":477},"PostgreSQL username",{"type":258,"tag":432,"props":479,"children":480},{},[481,489,494],{"type":258,"tag":459,"props":482,"children":483},{},[484],{"type":258,"tag":277,"props":485,"children":487},{"className":486},[],[488],{"type":264,"value":350},{"type":258,"tag":459,"props":490,"children":491},{},[492],{"type":264,"value":493},"—",{"type":258,"tag":459,"props":495,"children":496},{},[497],{"type":264,"value":498},"PostgreSQL password",{"type":258,"tag":432,"props":500,"children":501},{},[502,511,515],{"type":258,"tag":459,"props":503,"children":504},{},[505],{"type":258,"tag":277,"props":506,"children":508},{"className":507},[],[509],{"type":264,"value":510},"POSTGRES_DB",{"type":258,"tag":459,"props":512,"children":513},{},[514],{"type":264,"value":472},{"type":258,"tag":459,"props":516,"children":517},{},[518],{"type":264,"value":519},"PostgreSQL database name",{"type":258,"tag":417,"props":521,"children":523},{"id":522},"heaper-container",[524],{"type":264,"value":525},"Heaper Container",{"type":258,"tag":424,"props":527,"children":528},{},[529,547],{"type":258,"tag":428,"props":530,"children":531},{},[532],{"type":258,"tag":432,"props":533,"children":534},{},[535,539,543],{"type":258,"tag":436,"props":536,"children":537},{},[538],{"type":264,"value":440},{"type":258,"tag":436,"props":540,"children":541},{},[542],{"type":264,"value":445},{"type":258,"tag":436,"props":544,"children":545},{},[546],{"type":264,"value":450},{"type":258,"tag":452,"props":548,"children":549},{},[550,572,604,633,654,674],{"type":258,"tag":432,"props":551,"children":552},{},[553,562,567],{"type":258,"tag":459,"props":554,"children":555},{},[556],{"type":258,"tag":277,"props":557,"children":559},{"className":558},[],[560],{"type":264,"value":561},"HOSTNAME",{"type":258,"tag":459,"props":563,"children":564},{},[565],{"type":264,"value":566},"localhost",{"type":258,"tag":459,"props":568,"children":569},{},[570],{"type":264,"value":571},"Your domain name",{"type":258,"tag":432,"props":573,"children":574},{},[575,584,592],{"type":258,"tag":459,"props":576,"children":577},{},[578],{"type":258,"tag":277,"props":579,"children":581},{"className":580},[],[582],{"type":264,"value":583},"ENABLE_INTERNAL_POSTGRES",{"type":258,"tag":459,"props":585,"children":586},{},[587],{"type":258,"tag":312,"props":588,"children":589},{},[590],{"type":264,"value":591},"false",{"type":258,"tag":459,"props":593,"children":594},{},[595,597,602],{"type":264,"value":596},"Must be ",{"type":258,"tag":277,"props":598,"children":600},{"className":599},[],[601],{"type":264,"value":591},{"type":264,"value":603}," for this setup",{"type":258,"tag":432,"props":605,"children":606},{},[607,616,620],{"type":258,"tag":459,"props":608,"children":609},{},[610],{"type":258,"tag":277,"props":611,"children":613},{"className":612},[],[614],{"type":264,"value":615},"DB_HOST",{"type":258,"tag":459,"props":617,"children":618},{},[619],{"type":264,"value":493},{"type":258,"tag":459,"props":621,"children":622},{},[623,625,631],{"type":264,"value":624},"Postgres host and port (e.g. ",{"type":258,"tag":277,"props":626,"children":628},{"className":627},[],[629],{"type":264,"value":630},"postgres:5432",{"type":264,"value":632},")",{"type":258,"tag":432,"props":634,"children":635},{},[636,645,649],{"type":258,"tag":459,"props":637,"children":638},{},[639],{"type":258,"tag":277,"props":640,"children":642},{"className":641},[],[643],{"type":264,"value":644},"DB_USER",{"type":258,"tag":459,"props":646,"children":647},{},[648],{"type":264,"value":493},{"type":258,"tag":459,"props":650,"children":651},{},[652],{"type":264,"value":653},"Postgres username",{"type":258,"tag":432,"props":655,"children":656},{},[657,665,669],{"type":258,"tag":459,"props":658,"children":659},{},[660],{"type":258,"tag":277,"props":661,"children":663},{"className":662},[],[664],{"type":264,"value":358},{"type":258,"tag":459,"props":666,"children":667},{},[668],{"type":264,"value":493},{"type":258,"tag":459,"props":670,"children":671},{},[672],{"type":264,"value":673},"Postgres password",{"type":258,"tag":432,"props":675,"children":676},{},[677,686,690],{"type":258,"tag":459,"props":678,"children":679},{},[680],{"type":258,"tag":277,"props":681,"children":683},{"className":682},[],[684],{"type":264,"value":685},"DB_NAME",{"type":258,"tag":459,"props":687,"children":688},{},[689],{"type":264,"value":493},{"type":258,"tag":459,"props":691,"children":692},{},[693],{"type":264,"value":694},"Postgres database name",{"type":258,"tag":286,"props":696,"children":698},{"id":697},"using-an-existing-postgresql-instance",[699],{"type":264,"value":700},"Using an Existing PostgreSQL Instance",{"type":258,"tag":266,"props":702,"children":703},{},[704,706,713,715,721],{"type":264,"value":705},"If you already have a PostgreSQL server, you can skip the postgres container entirely. Make sure your database has the ",{"type":258,"tag":388,"props":707,"children":710},{"href":708,"rel":709},"https://github.com/janlunge/heaper-postgres",[392],[711],{"type":264,"value":712},"ULID extension",{"type":264,"value":714}," installed, then point the heaper container at your instance via the ",{"type":258,"tag":277,"props":716,"children":718},{"className":717},[],[719],{"type":264,"value":720},"DB_*",{"type":264,"value":722}," environment variables.",{"type":258,"tag":286,"props":724,"children":726},{"id":725},"next-steps",[727],{"type":264,"value":728},"Next Steps",{"type":258,"tag":730,"props":731,"children":732},"ul",{},[733,743,752],{"type":258,"tag":734,"props":735,"children":736},"li",{},[737],{"type":258,"tag":388,"props":738,"children":740},{"href":739},"/docs/self-hosting#backup--restore",[741],{"type":264,"value":742},"Backup & Restore",{"type":258,"tag":734,"props":744,"children":745},{},[746],{"type":258,"tag":388,"props":747,"children":749},{"href":748},"/docs/self-hosting#troubleshooting",[750],{"type":264,"value":751},"Troubleshooting",{"type":258,"tag":734,"props":753,"children":754},{},[755],{"type":258,"tag":388,"props":756,"children":758},{"href":757},"/docs/self-hosting#connecting-to-your-server",[759],{"type":264,"value":760},"Connecting to your server",{"title":252,"searchDepth":25,"depth":25,"links":762},[763,764,765,769,770],{"id":288,"depth":25,"text":291},{"id":397,"depth":25,"text":400},{"id":412,"depth":25,"text":415,"children":766},[767,768],{"id":419,"depth":53,"text":422},{"id":522,"depth":53,"text":525},{"id":697,"depth":25,"text":700},{"id":725,"depth":25,"text":728},"markdown","content:docs:self-hosting:separate-containers.md","content","docs/self-hosting/separate-containers.md","docs/self-hosting/separate-containers","md",1774954237966]