[{"data":1,"prerenderedAt":763},["ShallowReactive",2],{"\u002Fdocs\u002Fself-hosting\u002Fupgrading":3},{"id":4,"title":5,"body":6,"description":755,"extension":756,"meta":757,"navigation":758,"path":759,"seo":760,"stem":761,"__hash__":762},"docs\u002Fdocs\u002Fself-hosting\u002Fupgrading.md","Updates & Backups",{"type":7,"value":8,"toc":740},"minimark",[9,13,17,22,44,53,117,121,412,426,430,434,516,523,533,537,544,597,603,685,692,696,726,730,736],[10,11,5],"h1",{"id":12},"updates-backups",[14,15,16],"p",{},"Delivr keeps very little state — no mail, just users, settings, and encrypted credentials — so backups are small and updates are quick.",[18,19,21],"h2",{"id":20},"staying-informed","Staying informed",[14,23,24,25,32,33,38,39,43],{},"Releases are published on GitHub with release notes. To get notified, open the ",[26,27,31],"a",{"href":28,"rel":29},"https:\u002F\u002Fgithub.com\u002FDelivr-Project\u002FDelivr-API",[30],"nofollow","Delivr API"," and ",[26,34,37],{"href":35,"rel":36},"https:\u002F\u002Fgithub.com\u002FDelivr-Project\u002FDelivr-Web",[30],"Delivr Web"," repositories and choose ",[40,41,42],"strong",{},"Watch → Custom → Releases",".",[14,45,46,47,52],{},"Delivr follows ",[26,48,51],{"href":49,"rel":50},"https:\u002F\u002Fsemver.org",[30],"semantic versioning",":",[54,55,56,69],"table",{},[57,58,59],"thead",{},[60,61,62,66],"tr",{},[63,64,65],"th",{},"Version change",[63,67,68],{},"What to expect",[70,71,72,89,103],"tbody",{},[60,73,74,86],{},[75,76,77,78,82,83],"td",{},"Patch — ",[79,80,81],"code",{},"1.0.0"," → ",[79,84,85],{},"1.0.1",[75,87,88],{},"Bug and security fixes. Always safe to apply.",[60,90,91,100],{},[75,92,93,94,82,97],{},"Minor — ",[79,95,96],{},"1.0.x",[79,98,99],{},"1.1.0",[75,101,102],{},"New features, backwards compatible. May include database migrations.",[60,104,105,114],{},[75,106,107,108,82,111],{},"Major — ",[79,109,110],{},"1.x",[79,112,113],{},"2.0",[75,115,116],{},"Breaking changes. Read the upgrade notes before updating.",[18,118,120],{"id":119},"updating","Updating",[122,123,125,130,133,137,145,149,389,392,396,409],"steps",{"level":124},"3",[126,127,129],"h3",{"id":128},"read-the-release-notes","Read the release notes",[14,131,132],{},"Check both repositories' release notes for anything that needs your attention, such as new or renamed environment variables.",[126,134,136],{"id":135},"back-up","Back up",[14,138,139,140,144],{},"Take a ",[26,141,143],{"href":142},"#backups","backup"," of the database. Database migrations only run forward, so a backup is your way back.",[126,146,148],{"id":147},"pull-and-restart","Pull and restart",[150,151,152,222],"code-group",{},[153,154,160],"pre",{"className":155,"code":156,"filename":157,"language":158,"meta":159,"style":159},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","cd \u002Fopt\u002Fdelivr\nsudo docker compose pull\nsudo docker compose up -d\nsudo docker image prune -f\n","Docker","bash","",[79,161,162,175,191,206],{"__ignoreMap":159},[163,164,167,171],"span",{"class":165,"line":166},"line",1,[163,168,170],{"class":169},"s2Zo4","cd",[163,172,174],{"class":173},"sfazB"," \u002Fopt\u002Fdelivr\n",[163,176,178,182,185,188],{"class":165,"line":177},2,[163,179,181],{"class":180},"sBMFI","sudo",[163,183,184],{"class":173}," docker",[163,186,187],{"class":173}," compose",[163,189,190],{"class":173}," pull\n",[163,192,194,196,198,200,203],{"class":165,"line":193},3,[163,195,181],{"class":180},[163,197,184],{"class":173},[163,199,187],{"class":173},[163,201,202],{"class":173}," up",[163,204,205],{"class":173}," -d\n",[163,207,209,211,213,216,219],{"class":165,"line":208},4,[163,210,181],{"class":180},[163,212,184],{"class":173},[163,214,215],{"class":173}," image",[163,217,218],{"class":173}," prune",[163,220,221],{"class":173}," -f\n",[153,223,226],{"className":155,"code":224,"filename":225,"language":158,"meta":159,"style":159},"# See the manual installation guide for the full commands\ncd \u002Fopt\u002Fdelivr\u002Fapi && sudo -u delivr git fetch --tags && sudo -u delivr git checkout \u003Ctag> && sudo -u delivr bun install\ncd \u002Fopt\u002Fdelivr\u002Fweb && sudo -u delivr git fetch --tags && sudo -u delivr git checkout \u003Ctag> && sudo -u delivr bun install && sudo -u delivr bun run build\nsudo systemctl restart delivr-api delivr-web\n","Manual",[79,227,228,234,303,373],{"__ignoreMap":159},[163,229,230],{"class":165,"line":166},[163,231,233],{"class":232},"sHwdD","# See the manual installation guide for the full commands\n",[163,235,236,238,241,245,248,251,254,257,260,263,265,267,269,271,273,276,279,282,286,289,291,293,295,297,300],{"class":165,"line":177},[163,237,170],{"class":169},[163,239,240],{"class":173}," \u002Fopt\u002Fdelivr\u002Fapi",[163,242,244],{"class":243},"sMK4o"," &&",[163,246,247],{"class":180}," sudo",[163,249,250],{"class":173}," -u",[163,252,253],{"class":173}," delivr",[163,255,256],{"class":173}," git",[163,258,259],{"class":173}," fetch",[163,261,262],{"class":173}," --tags",[163,264,244],{"class":243},[163,266,247],{"class":180},[163,268,250],{"class":173},[163,270,253],{"class":173},[163,272,256],{"class":173},[163,274,275],{"class":173}," checkout",[163,277,278],{"class":243}," \u003C",[163,280,281],{"class":173},"ta",[163,283,285],{"class":284},"sTEyZ","g",[163,287,288],{"class":243},">",[163,290,244],{"class":243},[163,292,247],{"class":180},[163,294,250],{"class":173},[163,296,253],{"class":173},[163,298,299],{"class":173}," bun",[163,301,302],{"class":173}," install\n",[163,304,305,307,310,312,314,316,318,320,322,324,326,328,330,332,334,336,338,340,342,344,346,348,350,352,354,357,359,361,363,365,367,370],{"class":165,"line":193},[163,306,170],{"class":169},[163,308,309],{"class":173}," \u002Fopt\u002Fdelivr\u002Fweb",[163,311,244],{"class":243},[163,313,247],{"class":180},[163,315,250],{"class":173},[163,317,253],{"class":173},[163,319,256],{"class":173},[163,321,259],{"class":173},[163,323,262],{"class":173},[163,325,244],{"class":243},[163,327,247],{"class":180},[163,329,250],{"class":173},[163,331,253],{"class":173},[163,333,256],{"class":173},[163,335,275],{"class":173},[163,337,278],{"class":243},[163,339,281],{"class":173},[163,341,285],{"class":284},[163,343,288],{"class":243},[163,345,244],{"class":243},[163,347,247],{"class":180},[163,349,250],{"class":173},[163,351,253],{"class":173},[163,353,299],{"class":173},[163,355,356],{"class":173}," install",[163,358,244],{"class":243},[163,360,247],{"class":180},[163,362,250],{"class":173},[163,364,253],{"class":173},[163,366,299],{"class":173},[163,368,369],{"class":173}," run",[163,371,372],{"class":173}," build\n",[163,374,375,377,380,383,386],{"class":165,"line":208},[163,376,181],{"class":180},[163,378,379],{"class":173}," systemctl",[163,381,382],{"class":173}," restart",[163,384,385],{"class":173}," delivr-api",[163,387,388],{"class":173}," delivr-web\n",[14,390,391],{},"On start, the API applies any new database migrations automatically.",[126,393,395],{"id":394},"check","Check",[153,397,399],{"className":155,"code":398,"language":158,"meta":159,"style":159},"curl https:\u002F\u002Fapi.mail.example.com\u002Fhealth\n",[79,400,401],{"__ignoreMap":159},[163,402,403,406],{"class":165,"line":166},[163,404,405],{"class":180},"curl",[163,407,408],{"class":173}," https:\u002F\u002Fapi.mail.example.com\u002Fhealth\n",[14,410,411],{},"Then sign in and open a mailbox. Installed PWAs pick up the new version automatically the next time they're opened.",[413,414,415],"warning",{},[14,416,417,418,421,422,425],{},"Always update the API and the web client ",[40,419,420],{},"together"," and run the ",[40,423,424],{},"same version"," of both.",[18,427,429],{"id":428},"backups","Backups",[126,431,433],{"id":432},"what-to-back-up","What to back up",[54,435,436,449],{},[57,437,438],{},[60,439,440,443,446],{},[63,441,442],{},"What",[63,444,445],{},"Where",[63,447,448],{},"Why",[70,450,451,475,497],{},[60,452,453,458,472],{},[75,454,455],{},[40,456,457],{},"Database",[75,459,460,463,464,467,468,471],{},[79,461,462],{},"data\u002Fdb.sqlite"," (Docker: ",[79,465,466],{},".\u002Fdata\u002F",", manual: ",[79,469,470],{},"\u002Fopt\u002Fdelivr\u002Fapi\u002Fdata\u002F",")",[75,473,474],{},"Users, sessions, preferences, identities, and encrypted mail-account credentials.",[60,476,477,482,491],{},[75,478,479],{},[40,480,481],{},"Encryption key",[75,483,484,487,488],{},[79,485,486],{},"DLA_ENCRYPTION_KEY"," in your Compose file or ",[79,489,490],{},".env",[75,492,493,494],{},"Needed to decrypt the stored credentials. ",[40,495,496],{},"Store it separately from the database backup.",[60,498,499,504,513],{},[75,500,501],{},[40,502,503],{},"Configuration",[75,505,506,509,510,512],{},[79,507,508],{},"docker-compose.yml",", ",[79,511,490],{},", systemd units, proxy config",[75,514,515],{},"Lets you rebuild the server quickly.",[14,517,518,519,522],{},"You don't need to back up mail — it stays on your users' mail servers. Logs in ",[79,520,521],{},"data\u002Flogs\u002F"," are optional.",[524,525,526],"caution",{},[14,527,528,529,532],{},"A database backup ",[40,530,531],{},"plus"," the encryption key is enough to decrypt every user's IMAP\u002FSMTP password. Keep them in different places, and encrypt your backups.",[126,534,536],{"id":535},"back-up-the-database","Back up the database",[14,538,539,540,543],{},"SQLite can take a consistent copy while Delivr keeps running. Install the ",[79,541,542],{},"sqlite3"," tool on the host and run:",[153,545,547],{"className":155,"code":546,"language":158,"meta":159,"style":159},"sudo apt install -y sqlite3\nsudo sqlite3 \u002Fopt\u002Fdelivr\u002Fdata\u002Fdb.sqlite \".backup '\u002Fvar\u002Fbackups\u002Fdelivr-$(date +%F).sqlite'\"\n",[79,548,549,564],{"__ignoreMap":159},[163,550,551,553,556,558,561],{"class":165,"line":166},[163,552,181],{"class":180},[163,554,555],{"class":173}," apt",[163,557,356],{"class":173},[163,559,560],{"class":173}," -y",[163,562,563],{"class":173}," sqlite3\n",[163,565,566,568,571,574,577,580,583,586,589,591,594],{"class":165,"line":177},[163,567,181],{"class":180},[163,569,570],{"class":173}," sqlite3",[163,572,573],{"class":173}," \u002Fopt\u002Fdelivr\u002Fdata\u002Fdb.sqlite",[163,575,576],{"class":243}," \"",[163,578,579],{"class":173},".backup '\u002Fvar\u002Fbackups\u002Fdelivr-",[163,581,582],{"class":243},"$(",[163,584,585],{"class":180},"date",[163,587,588],{"class":173}," +%F",[163,590,471],{"class":243},[163,592,593],{"class":173},".sqlite'",[163,595,596],{"class":243},"\"\n",[14,598,599,600,52],{},"Adjust the path to your data directory. To automate it, add a daily cron job in ",[79,601,602],{},"\u002Fetc\u002Fcron.d\u002Fdelivr-backup",[153,604,607],{"className":155,"code":605,"filename":606,"language":158,"meta":159,"style":159},"30 3 * * * root sqlite3 \u002Fopt\u002Fdelivr\u002Fdata\u002Fdb.sqlite \".backup '\u002Fvar\u002Fbackups\u002Fdelivr-$(date +\\%F).sqlite'\" && find \u002Fvar\u002Fbackups -name 'delivr-*.sqlite' -mtime +14 -delete\n","crontab",[79,608,609],{"__ignoreMap":159},[163,610,611,614,618,621,623,625,628,630,632,634,636,638,640,643,646,649,651,653,656,658,661,664,667,670,673,676,679,682],{"class":165,"line":166},[163,612,613],{"class":180},"30",[163,615,617],{"class":616},"sbssI"," 3",[163,619,620],{"class":284}," *",[163,622,620],{"class":284},[163,624,620],{"class":284},[163,626,627],{"class":173}," root",[163,629,570],{"class":173},[163,631,573],{"class":173},[163,633,576],{"class":243},[163,635,579],{"class":173},[163,637,582],{"class":243},[163,639,585],{"class":180},[163,641,642],{"class":173}," +",[163,644,645],{"class":284},"\\%",[163,647,648],{"class":173},"F",[163,650,471],{"class":243},[163,652,593],{"class":173},[163,654,655],{"class":243},"\"",[163,657,244],{"class":243},[163,659,660],{"class":180}," find",[163,662,663],{"class":173}," \u002Fvar\u002Fbackups",[163,665,666],{"class":173}," -name",[163,668,669],{"class":243}," '",[163,671,672],{"class":173},"delivr-*.sqlite",[163,674,675],{"class":243},"'",[163,677,678],{"class":173}," -mtime",[163,680,681],{"class":173}," +14",[163,683,684],{"class":173}," -delete\n",[14,686,687,688,691],{},"Then copy ",[79,689,690],{},"\u002Fvar\u002Fbackups"," to off-site storage with the tool of your choice (restic, borg, rclone, …).",[126,693,695],{"id":694},"restore-from-a-backup","Restore from a backup",[697,698,699,711,717,723],"ol",{},[700,701,702,703,706,707,710],"li",{},"Stop the API: ",[79,704,705],{},"docker compose stop delivr-api"," (or ",[79,708,709],{},"systemctl stop delivr-api",").",[700,712,713,714,716],{},"Replace ",[79,715,462],{}," with your backup file and make sure the service can read and write it.",[700,718,719,720,722],{},"Make sure ",[79,721,486],{}," is the key that was in use when the backup was taken.",[700,724,725],{},"Start the API again. If the backup is from an older version, pending migrations run on start.",[18,727,729],{"id":728},"changing-the-encryption-key","Changing the encryption key",[14,731,732,733,735],{},"There is no automatic key rotation yet. If you change ",[79,734,486],{},", Delivr can no longer decrypt the stored mail-account credentials, and every user has to re-enter the passwords of their mail accounts. Only change it if you believe the key was compromised.",[737,738,739],"style",{},"html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":159,"searchDepth":177,"depth":177,"links":741},[742,743,749,754],{"id":20,"depth":177,"text":21},{"id":119,"depth":177,"text":120,"children":744},[745,746,747,748],{"id":128,"depth":193,"text":129},{"id":135,"depth":193,"text":136},{"id":147,"depth":193,"text":148},{"id":394,"depth":193,"text":395},{"id":428,"depth":177,"text":429,"children":750},[751,752,753],{"id":432,"depth":193,"text":433},{"id":535,"depth":193,"text":536},{"id":694,"depth":193,"text":695},{"id":728,"depth":177,"text":729},"Update Delivr safely, back up the database and encryption key, and restore an instance from a backup.","md",{},{"title":5},"\u002Fdocs\u002Fself-hosting\u002Fupgrading",{"title":5,"description":755},"docs\u002Fself-hosting\u002Fupgrading","X3LkSQ4v9QrSVZmZFi4qzPEZUvG7qap322KZzNTpWhg",1791069427510]