PageSourceSearch

https://woodpecker-ci.org/assets/js/5f988e1e.77ff99ea.js

js woodpecker-ci.org collected 2026-10-04 00:29:48 UTC 6,053 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwoodpecker=self.webpackChunkwoodpecker||[]).push([["1991"],{37743(e,a,t){t.r(a),t.d(a,{metadata:()=>s,default:()=>u,frontMatter:()=>i,contentTitle:()=>n,toc:()=>c,assets:()=>d});var s=JSON.parse('{"id":"administration/database","title":"Databases","description":"The default database engine of Woodpecker is an embedded SQLite database which requires zero installation or configuration. But you can replace it with a MySQL/MariaDB or Postgres database.","source":"@site/versioned_docs/version-2.8/30-administration/10-database.md","sourceDirName":"30-administration","slug":"/administration/database","permalink":"/docs/2.8/administration/database","draft":false,"unlisted":false,"editUrl":"https://github.com/woodpecker-ci/woodpecker/edit/main/docs/versioned_docs/version-2.8/30-administration/10-database.md","tags":[],"version":"2.8","sidebarPosition":10,"frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"NixOS","permalink":"/docs/2.8/administration/deployment-methods/nixos"},"next":{"title":"Server configuration","permalink":"/docs/2.8/administration/server-config"}}'),r=t(94686),o=t(23191);let i={},n="Databases",d={},c=[{value:"Configure SQLite",id:"configure-sqlite",level:2},{value:"Configure MySQL/MariaDB",id:"configure-mysqlmariadb",level:2},{value:"Configure Postgres",id:"configure-postgres",level:2},{value:"Database Creation",id:"database-creation",level:2},{value:"Database Migration",id:"database-migration",level:2},{value:"Database Backups",id:"database-backups",level:2},{value:"Database Archiving",id:"database-archiving",level:2}];function l(e){let a={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",strong:"strong",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.header,{children:(0,r.jsx)(a.h1,{id:"databases",children:"Databases"})}),"\n",(0,r.jsx)(a.p,{children:"The default database engine of Woodpecker is an embedded SQLite database which requires zero installation or configuration. But you can replace it with a MySQL/MariaDB or Postgres database."}),"\n",(0,r.jsx)(a.h2,{id:"configure-sqlite",children:"Configure SQLite"}),"\n",(0,r.jsxs)(a.p,{children:["By default Woodpecker uses a SQLite database stored under ",(0,r.jsx)(a.code,{children:"/var/lib/woodpecker/"}),". If using containers, you can mount a ",(0,r.jsx)(a.a,{href:"https://docs.docker.com/storage/volumes/#create-and-manage-volumes",children:"data volume"})," to persist the SQLite database."]}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-diff",metastring:'title="docker-compose.yaml"',children:" version: '3'\n\n services:\n   woodpecker-server:\n     [...]\n+    volumes:\n+      - woodpecker-server-data:/var/lib/woodpecker/\n"})}),"\n",(0,r.jsx)(a.h2,{id:"configure-mysqlmariadb",children:"Configure MySQL/MariaDB"}),"\n",(0,r.jsxs)(a.p,{children:["The below example demonstrates MySQL database configuration. See the official driver ",(0,r.jsx)(a.a,{href:"https://github.com/go-sql-driver/mysql#dsn-data-source-name",children:"documentation"})," for configuration options and examples.\nThe minimum version of MySQL/MariaDB required is determined by the ",(0,r.jsx)(a.code,{children:"go-sql-driver/mysql"})," - see ",(0,r.jsx)(a.a,{href:"https://github.com/go-sql-driver/mysql#requirements",children:"it's README"})," for more information."]}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-ini",children:"WOODPECKER_DATABASE_DRIVER=mysql\nWOODPECKER_DATABASE_DATASOURCE=root:password@tcp(1.2.3.4:3306)/woodpecker?parseTime=true\n"})}),"\n",(0,r.jsx)(a.h2,{id:"configure-postgres",children:"Configure Postgres"}),"\n",(0,r.jsxs)(a.p,{children:["The below example demonstrates Postgres database configuration. See the official driver ",(0,r.jsx)(a.a,{href:"https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING",children:"documentation"})," for configuration options and examples.\nPlease use Postgres versions equal or higher than ",(0,r.jsx)(a.strong,{children:"11"}),"."]}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-ini",children:"WOODPECKER_DATABASE_DRIVER=postgres\nWOODPECKER_DATABASE_DATASOURCE=postgres://root:[email protected]:5432/postgres?sslmode=disable\n"})}),"\n",(0,r.jsx)(a.h2,{id:"database-creation",children:"Database Creation"}),"\n",(0,r.jsxs)(a.p,{children:["Woodpecker does not create your database automatically. If you are using the MySQL or Postgres driver you will need to manually create your database using ",(0,r.jsx)(a.code,{children:"CREATE DATABASE"}),"."]}),"\n",(0,r.jsx)(a.h2,{id:"database-migration",children:"Database Migration"}),"\n",(0,r.jsx)(a.p,{children:"Woodpecker automatically handles database migration, including the initial creation of tables and indexes. New versions of Woodpecker will automatically upgrade the database unless otherwise specified in the release notes."}),"\n",(0,r.jsx)(a.h2,{id:"database-backups",children:"Database Backups"}),"\n",(0,r.jsx)(a.p,{children:"Woodpecker does not perform database backups. This should be handled by separate third party tools provided by your database vendor of choice."}),"\n",(0,r.jsx)(a.h2,{id:"database-archiving",children:"Database Archiving"}),"\n",(0,r.jsx)(a.p,{children:"Woodpecker does not perform data archival; it considered out-of-scope for the project. Woodpecker is rather conservative with the amount of data it stores, however, you should expect the database logs to grow the size of your database considerably."})]})}function u(e={}){let{wrapper:a}={...(0,o.R)(),...e.components};return a?(0,r.jsx)(a,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},23191(e,a,t){t.d(a,{R:()=>i,x:()=>n});var s=t(92990);let r={},o=s.createContext(r);function i(e){let a=s.useContext(o);return s.useMemo(function(){return"function"==typeof e?e(a):{...a,...e}},[a,e])}function n(e){let a;return a=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),s.createElement(o.Provider,{value:a},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.