This guide moves Rundeck off its embedded H2 database and onto MySQL or PostgreSQL, which is what you should use in production. The steps above set up MySQL. Below you will find fixes for MySQL 8, the matching PostgreSQL setup, the dataSource settings for each database, and how to move your existing jobs and execution history. Changing the dataSource on its own does not copy any data.
Rundeck Database Migration From H2 to MySql
Step 1 – Install mySql Server
Step 2 – Create rundeck db and rundeckuser and set their permissing
$ mysql -u root -p
mysql> create database rundeck;
mysql> grant ALL on rundeck.* to 'rundeckuser'@'localhost' identified by 'rundeckpassword';
$ mysql -u rundeckuser -p
mysql> show databases;Code language: JavaScript (javascript)
Step 3 – Configuring Rundeck to connect to mysql DB
Update your rundeck-config.properties file with settings from the following database list and restart Rundeck. This file is located in different locations depending on your installation method:
- RPM/DEB:
/etc/rundeck/rundeck-config.properties - WAR/Custom:
$RDECK_BASE/server/config/rundeck-config.properties


Step 4 – Change Server URL of grails.serverUrl
The configuration option grails.serverUrl must be set properly. The value should match the URL users would use to access Rundeck(ie the URL they would enter into the browser).
For Docker this should be configured with the RUNDECK_GRAILS_URL environment variable.
For deb, rpm, and war this will be set as grails.serverUrl= in the rundeck-config.properties file
Step 5 – Copy MySQL JDBC Driver
To use the Oracle MySQL driver download it and copy it to the $RDECK_BASE/server/lib for war launcher or in /var/lib/rundeck/lib (create it) for RPM and DEB installations.
$ mkdir /var/lib/rundeck/lib
$ MYSQLJ_VERS=8.0.21
$ curl -L -o https://repo1.maven.org/maven2/mysql/mysql-connector-java/${MYSQLJ_VERS}/mysql-connector-java-${MYSQLJ_VERS}.jar
Code language: JavaScript (javascript)
Step 6 – restart Rundeck
$ sudo service rundeckd restart
Why move off H2, and what migration really means
A fresh Rundeck install stores everything in an embedded H2 file database under /var/lib/rundeck/data. That includes jobs, execution history, project configuration and, by default, Key Storage. H2 is fine for a trial. It is not suitable for production: it does not support clustering, it is hard to back up while Rundeck is running, and the files can be corrupted after an unclean shutdown.
When you point rundeck-config.properties at a new database, Rundeck starts against an empty schema and creates its tables on the first start. Nothing is copied over from H2. There is no built-in tool that converts H2 to MySQL or PostgreSQL. The supported way to migrate is to export your projects from the old setup and import them into the new one, as described below.
Note: Before you change anything, stop Rundeck and back up /var/lib/rundeck/data, /etc/rundeck and /var/lib/rundeck/logs. If something goes wrong, restoring these and reverting the config puts you back on H2.
Corrected MySQL database and user setup
The GRANT ... IDENTIFIED BY statement in step 2 above was removed in MySQL 8.0. On MySQL 8 it fails with a syntax error. You now create the user first and then grant privileges. Creating the database with utf8mb4 also avoids character set problems with job definitions that contain non-ASCII text.
$ sudo mysql -u root -p
mysql> CREATE DATABASE rundeck CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
mysql> CREATE USER 'rundeckuser'@'localhost' IDENTIFIED BY 'Use-A-Strong-Password';
mysql> GRANT ALL PRIVILEGES ON rundeck.* TO 'rundeckuser'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> exit
$ mysql -u rundeckuser -p -e 'SHOW DATABASES;'Code language: PHP (php)
The last command should list rundeck together with information_schema. If MySQL runs on a different host from Rundeck, replace 'localhost' with the Rundeck server's IP address or a suitable host pattern. A user created for localhost cannot log in from another machine.
Corrected JDBC driver download
The curl command in step 5 above is broken. -o expects a file name, so it treats the URL as the output file name and has nothing left to download. The Maven artifact was also renamed from mysql:mysql-connector-java to com.mysql:mysql-connector-j in later 8.0.x releases. Pick a current Connector/J version from Maven Central and set MYSQLJ_VERS to it.
$ sudo mkdir -p /var/lib/rundeck/lib
$ MYSQLJ_VERS=<connector-j-version> # an 8.x or 9.x release from Maven Central
$ sudo curl -fL -o /var/lib/rundeck/lib/mysql-connector-j-${MYSQLJ_VERS}.jar \
https://repo1.maven.org/maven2/com/mysql/mysql-connector-j/${MYSQLJ_VERS}/mysql-connector-j-${MYSQLJ_VERS}.jar
$ sudo chown -R rundeck:rundeck /var/lib/rundeck/lib
$ ls -l /var/lib/rundeck/libCode language: PHP (php)
Note: Rundeck already ships with MariaDB and PostgreSQL JDBC drivers. You only need this jar if you want to use the Oracle MySQL driver class com.mysql.cj.jdbc.Driver. If you use the bundled org.mariadb.jdbc.Driver instead, skip this step.
dataSource settings for MySQL and PostgreSQL
The screenshots above show the database settings. Below they are as text you can copy. In rundeck-config.properties, replace or comment out the existing H2 dataSource.url line. Do not leave two dataSource.url entries in the file.
# /etc/rundeck/rundeck-config.properties (MySQL with Oracle Connector/J)
grails.serverUrl=http://rundeck.example.com:4440
dataSource.driverClassName=com.mysql.cj.jdbc.Driver
dataSource.url=jdbc:mysql://localhost:3306/rundeck?autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
dataSource.username=rundeckuser
dataSource.password=Use-A-Strong-Password
# Alternative: bundled MariaDB driver (no extra jar needed)
# dataSource.driverClassName=org.mariadb.jdbc.DriverCode language: PHP (php)
allowPublicKeyRetrieval=true is required when MySQL 8 uses its default caching_sha2_password authentication over a connection without TLS. In production, enable TLS on MySQL and set useSSL=true, or sslMode=REQUIRED with Connector/J. Do not disable encryption across a network.
# /etc/rundeck/rundeck-config.properties (PostgreSQL, bundled driver)
grails.serverUrl=http://rundeck.example.com:4440
dataSource.driverClassName=org.postgresql.Driver
dataSource.url=jdbc:postgresql://localhost:5432/rundeck
dataSource.username=rundeckuser
dataSource.password=Use-A-Strong-PasswordCode language: PHP (php)
Older guides also set dataSource.dialect. Current Rundeck releases detect the dialect from the connection, so you only need to set it if your version's documentation says to. For Docker, use the environment variables RUNDECK_DATABASE_DRIVER, RUNDECK_DATABASE_URL, RUNDECK_DATABASE_USERNAME, RUNDECK_DATABASE_PASSWORD and RUNDECK_GRAILS_URL instead of editing the file.
PostgreSQL database setup
The original post covers MySQL only. For PostgreSQL, make rundeckuser the owner of the database. Since PostgreSQL 15, ordinary users can no longer create objects in the public schema by default, so a plain GRANT ALL ON DATABASE is not enough. Making the user the owner avoids that problem.
$ sudo -u postgres psql
postgres=# CREATE USER rundeckuser WITH PASSWORD 'Use-A-Strong-Password';
postgres=# CREATE DATABASE rundeck OWNER rundeckuser ENCODING 'UTF8';
postgres=# \q
$ psql -h localhost -U rundeckuser -d rundeck -c 'SELECT current_user;'Code language: PHP (php)
If the test login fails with password authentication failed or no pg_hba.conf entry, add a host rundeck rundeckuser 127.0.0.1/32 scram-sha-256 line to pg_hba.conf (use the Rundeck server's address if it runs on another host). Then reload PostgreSQL with sudo systemctl reload postgresql.
Moving existing jobs and history from H2
- While Rundeck is still running on H2, open each project and go to Project Settings > Export Archive. Include jobs, executions, configuration and ACLs. Save the
.jararchive files. - Write down every secret in Key Storage (passwords and SSH keys). By default these are stored in the H2 database, and project archives do not include them.
- Stop Rundeck with
sudo systemctl stop rundeckd, back up the H2 data, then make therundeck-config.propertieschanges described above. - Start Rundeck with
sudo systemctl start rundeckdand follow/var/log/rundeck/service.loguntil the schema has been created and the server reports it has started. - Create each project again with the same name, then use Project Settings > Import Archive to load its
.jarfile. - Add the Key Storage entries again at the same paths so jobs and node sources can still find them.
- Run a few jobs and check that the execution history and job schedules look correct.
If you use the rd command-line tool, rd projects archives export -p NAME -f NAME.jar and rd projects archives import -p NAME -f NAME.jar let you script steps 1 and 5 when you have many projects.
Verify the new database is in use
$ sudo systemctl restart rundeckd
$ sudo tail -f /var/log/rundeck/service.log
# MySQL
$ mysql -u rundeckuser -p rundeck -e 'SHOW TABLES;' | head
# PostgreSQL
$ psql -h localhost -U rundeckuser -d rundeck -c '\dt' | headCode language: PHP (php)
You should see Rundeck tables such as execution and scheduled_execution. If the database is still empty after a successful start, Rundeck is probably reading a different config file or is still pointing at H2. Run grep dataSource /etc/rundeck/rundeck-config.properties to check. On current systems, systemctl restart rundeckd does the same job as the service command in step 6 above.
Common errors and fixes
| Error in service.log | Cause | Fix |
|---|---|---|
ClassNotFoundException: com.mysql.cj.jdbc.Driver | The jar is missing from /var/lib/rundeck/lib, or the rundeck user cannot read it | Check the file exists and its ownership, or switch to the bundled org.mariadb.jdbc.Driver |
Public Key Retrieval is not allowed | MySQL 8 caching_sha2_password over a connection without TLS | Add allowPublicKeyRetrieval=true or enable TLS |
Access denied for user 'rundeckuser'@'...' | The user's host does not match where Rundeck connects from, or the password is wrong | Create the user for the correct host and check dataSource.password |
permission denied for schema public | PostgreSQL 15+ default privileges | Make rundeckuser the database owner, or run GRANT ALL ON SCHEMA public TO rundeckuser |
Login redirects to localhost:4440 | grails.serverUrl is wrong | Set it to the URL users actually open in the browser |
Note: rundeck-config.properties holds the database password in plain text. Restrict the file with chmod 640 and chown root:rundeck. Give the database user privileges on the rundeck database only.
Frequently asked questions
Does changing the dataSource migrate my Rundeck data from H2?
No. Rundeck creates a new empty schema in MySQL or PostgreSQL. To keep jobs and history, export project archives before you switch and import them afterwards.
Do I need to download a JDBC driver for Rundeck?
Usually not. Rundeck bundles MariaDB and PostgreSQL drivers. The MariaDB driver works with MySQL. You only need to add the Oracle Connector/J jar if you want to use com.mysql.cj.jdbc.Driver.
Why does GRANT … IDENTIFIED BY fail on MySQL 8?
MySQL 8.0 removed the ability to create a user through GRANT. Run CREATE USER ... IDENTIFIED BY ... first, then GRANT ALL PRIVILEGES ON rundeck.* TO ....
Are Key Storage secrets included in a project archive?
No. With the default database-backed Key Storage, passwords and keys stay in the old database. You must add them again at the same paths after the migration.
Where is rundeck-config.properties located?
For RPM and DEB installs it is /etc/rundeck/rundeck-config.properties. For WAR installs it is $RDECK_BASE/server/config/rundeck-config.properties. Docker images are configured through RUNDECK_DATABASE_* environment variables.
Related tutorials
- More SQL & MySQL tutorials
- Top 50 Interview question and answers of MySQL
- Datadog Tutorials: Datadog Agent integration with mysql databases?
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services โ all in one place.
Explore Hospitals
That is not a migration, My data in the H2 did not migrate to the mysql database.
Gary