Installing Raft DB
Install Raft DB with one installer for Windows (a setup wizard) and one for Linux. It adds the server and the MySQL, SQL Server, PostgreSQL and graph programs on their default ports or the next free ones, and how to upgrade, remove and find everything afterwards.
The setup installs the whole product in one step: the database server and the programs that let MySQL, MariaDB, SQL Server, PostgreSQL and graph (Bolt) clients talk to it. Each program gets its default port. If that port is already in use on the machine, for example by a MySQL or PostgreSQL that is already installed, the setup takes the next free port and tells you which one.
Install on Windows#
There is one Windows installer, RaftDBSetup-<version>.exe. It runs on PCs with an Intel or AMD processor and on PCs with an ARM processor (for example Snapdragon laptops) and finds out by itself which one it is on. To check the download, compare its SHA-256 with the value in the .sha256 file next to it.
- Double-click
RaftDBSetup-<version>.exeand allow the administrator prompt. A setup wizard opens. - Welcome.
- Choosing a Setup Type:
- Typical: the server, the MySQL / MariaDB, SQL Server, PostgreSQL and graph programs, the Studio and the command-line tools, each on its default port or the next free one.
- Server only: the engine, its native API and the Studio. Nothing listens on the SQL or graph ports.
- Custom: you choose the products and the install folder.
- Select Products and Features: a list of the products. You can change it for Custom; for the other types it is shown so that you can see what will be installed. The server is always installed.
- Check Requirements: 64-bit Windows, administrator rights, free disk space, and each port that will be used. A port that is in use is a warning, not a stop: the next free port will be used. Only a failed requirement stops the setup.
- Installation: the programs are copied. A table shows each product as Ready to install, Installing and Complete, and a progress bar moves as they finish.
- Product Configuration, in five pages:
- Type and Networking: the port of each program (you can change them; the wizard checks that they are valid, different and free) and Allow other computers to connect (LAN), off by default. Open these ports in Windows Firewall can be ticked only when LAN is on. See "Who can connect" below.
- Accounts and Roles: the password of the
adminaccount (a random one is generated and shown, or you choose your own) and, if you like, further accounts. Add User, Edit and Delete manage the list: a user name, a password (or a generated one), a role (Administrator, Developer with read and write, or Read only) and, if you tick it, a database with the same name. See "Accounts" below. - Windows Service: run Raft DB in the background (on by default) and start it with Windows (on by default). The programs run as startup tasks under the Local System account, named
Raft DB raftdb-.... - Error Reports: Send error reports to the Raft DB team is off. Only diagnostics would be sent (the version, the system, the error text and where it happened), never your data. See "Error reports" below.
- Apply Configuration: click Execute. The wizard writes the settings, creates the accounts, creates the services, starts them and checks that each port answers, with a check mark for each step and a log.
- Installation Complete: the page lists the program ports and the login. You can tick Open Raft DB Studio in the browser and Open the install summary. The summary is saved as
%ProgramData%\RaftDB\install-summary.txtand has the address, the port each program ended up with, the user name and the password.
Cancel before the Installation page changes nothing on the computer.
The installer and the programs in it are digitally signed, so Windows shows the publisher in its confirmation window. Raft DB also appears in Settings > Apps > Installed apps.
Started with options (for example /S for a silent install), the installer shows no window; see "Silent install" below.
What the setup does:
- Copies the programs to
%ProgramFiles%\RaftDBand puts the data, settings and logs under%ProgramData%\RaftDB. - Makes a random admin password (or uses the one you chose). There is no default password.
- Writes the settings of every program, with the ports it chose.
- Registers each program to start when Windows starts (a startup task running as SYSTEM, one per program, named
Raft DB raftdb-server,Raft DB raftdb-mysql,Raft DB raftdb-mssql,Raft DB raftdb-pg,Raft DB raftdb-bolt). - Starts them, waits until each one answers (at most 60 seconds each) and then writes the summary.
Ports#
| Program | Speaks | Default port |
|---|---|---|
| Raft DB server | native protocol, HTTP API and the Studio | 7480 |
| MySQL / MariaDB | MySQL protocol | 3306 |
| SQL Server | SQL Server (TDS) protocol | 1433 |
| PostgreSQL | PostgreSQL protocol | 5432 |
| Graph | Bolt protocol (Cypher) | 7687 |
The next-free-port rule. A port counts as taken if it cannot be opened on the address the program will use, if something already listens on it on any address, or if something answers on it on this machine. The setup then tries the next number, then the one after, up to 50 numbers above the default, and never gives the same port to two of its own programs. The summary says what happened, for example:
MySQL / MariaDB: wanted 3306, taken, using 3307
PostgreSQL: wanted 5432, taken, using 5433The port that was chosen is written into the settings of the program, so the program and the summary always agree. Connect your tools and applications to the port in the summary.
Who can connect#
By default every program listens on 127.0.0.1, so only programs on the same machine can connect. The startup tasks carry no password: each runs a small helper that reads the settings from files only Administrators and the system can open. The SQL Server, PostgreSQL and graph programs take their password as a program argument, so it is visible to administrators in the process list; the MySQL program reads its settings from a file.
The Allow other computers to connect (LAN) box of the wizard, or --lan on the command line, lets other machines reach the MySQL, SQL Server, PostgreSQL and graph ports (they then listen on all addresses, 0.0.0.0). The summary then carries a warning. Before you turn it on:
- Windows Firewall still blocks incoming connections until a rule for the ports in the summary exists. Tick Open these ports in Windows Firewall in the wizard (or use
--open-firewall) and the setup adds one rule per front-end port; the uninstall removes them. Without it the setup does not change the firewall. - Traffic is not encrypted unless you set up certificates for the program (see TLS and encryption).
- Anybody who can reach the port can try to log in with the
adminaccount.
The server's own port (7480: native protocol, HTTP API and Studio) always stays on this machine.
One server, several front-ends#
The MySQL, SQL Server and PostgreSQL programs all work on the one server, with one set of data on disk, one user list for the server and one name space for databases: a database name made through one of them cannot be reused through another. Each of them shows the databases made through itself, so a database created with the mysql client is listed by MySQL tools and by the server's Studio, but not in psql or sqlcmd. The graph program keeps its own graph file.
Connecting afterwards#
The summary has the exact lines. With the default ports, and your own port numbers from the summary, they look like this:
mysql -h 127.0.0.1 -P 3306 -u admin -p
psql "host=127.0.0.1 port=5432 user=admin dbname=postgres"
sqlcmd -S 127.0.0.1,1433 -U admin -IThe Studio is at http://127.0.0.1:7480/ (with the server's port from the summary). Sign in with the user admin and the password from the summary.
Accounts#
The admin account always exists. The wizard's Accounts and Roles page (or --users-file in a silent install) can make more accounts while Raft DB is installed. Each account has a role:
| Role | May |
|---|---|
| Administrator | everything: databases, tables, data and users |
| Developer | read and write data |
| Read only | read data |
Raft DB programs keep their logins in different places, so the setup writes each account where each program can use it:
| Program | What the new accounts can do there |
|---|---|
| Server: native protocol, HTTP API and the Studio | every account, with its role |
| Graph (Bolt) | every account, with its role |
| MySQL / MariaDB | Administrator accounts. Make Developer and Read only users there with CREATE USER and GRANT. |
| SQL Server and PostgreSQL | none: each of these programs has one login, admin |
The setup checks after the start that every new account can log in. The summary lists the names and roles, never the passwords. User names have 1 to 32 letters, digits, _, . or -; admin and frontends are taken. Passwords have 8 to 128 characters and no space, #, :, " or \.
Error reports#
The wizard has a page for one choice: whether to send error reports to the Raft DB team. Only diagnostics would be sent (the version, the system, the error text and where it happened), never your data. The default is no. A silent install (/S) says no unless you give --error-reports. Your choice is saved in %ProgramData%\RaftDB\error-reports.conf (error_reports = on or off); an upgrade keeps it. To change it later, edit that file, or run the setup again with --error-reports or --no-error-reports. Removing the data folder with --purge removes the file too.
Silent install#
RaftDBSetup-<version>.exe /S [--setup-type typical|server|custom] [--components LIST] [--dir PATH] [--data PATH] [--port NAME=N]
[--lan [--open-firewall]] [--no-service] [--no-autostart] [--no-start]
[--admin-password-file FILE] [--users-file FILE] [--error-reports]| Option | Meaning |
|---|---|
/S or --silent | No window, no questions. Run it from an elevated prompt. The same options work without /S too (for example --print): the wizard only appears when you start the installer with no options at all. |
--dir PATH | Program folder. Default %ProgramFiles%\RaftDB. |
--data PATH | Data folder. Default %ProgramData%\RaftDB. |
--setup-type T | typical (everything, the default), server (the engine, its native API and the Studio) or custom (needs --components). |
--components LIST | A comma list of server, mysql, mssql, pg, bolt, studio, tools, watcher. The server is always installed. |
--lan | Accept other machines on the MySQL, SQL Server, PostgreSQL and graph ports. --no-lan goes back. With --open-firewall the setup also adds Windows Firewall rules for those ports. |
--no-autostart | Register and start the programs now, but do not start them with Windows. |
--admin-password-file FILE | The admin password, from the first line of a file. You can also set the environment variable RAFTDB_ADMIN_PASSWORD for the installer's process. The password is never an option on the command line. Without either, a random one is made. An upgrade keeps the earlier password. |
--users-file FILE | More accounts, one per line: NAME, ROLE, CREATEDB, PASSWORD separated by tab characters. ROLE is admin, developer or readonly; CREATEDB is 1 to make a database with the same name, else 0. See "Accounts". |
--no-start | Register the programs but do not start them. |
--no-service | Do not register startup tasks. The setup starts the programs itself; for a trial. They stop at --uninstall. |
--port NAME=N | Ask for port N for server, mysql, mssql, pg or bolt. A taken port still moves on to the next free one. |
--error-reports | Opt in to error reports (see above). --no-error-reports is the default. |
--print | Show the plan, with the ports it would choose on this machine, and change nothing. |
--flat | Put the programs of a new installation straight into the program folder (the layout of versions before 0.0.5) instead of a version folder; see "Where things are". An existing installation keeps its layout either way. |
Exit codes: 0 installed; 1 the setup failed (the message says where); 2 a wrong option; 4 installed, but at least one program does not answer (see the logs folder).
Run RaftDBSetup-<version>.exe --print first to see which ports your machine would give each program.
Upgrade#
Run the newer installer over the existing installation. The wizard shows the choices of the earlier install. It stops the programs, replaces them, and starts them again. In the version layout the new version goes into its own folder versions\<version> and current.txt is switched to it (the old version's folder stays, previous.txt names it); an installation in the older flat layout is upgraded in place and stays flat. The data, the settings, the passwords and the ports of the earlier install are kept; a port is only changed if something else has taken it in the meantime. The summary is written again.
Uninstall#
Use Raft DB in Settings > Apps > Installed apps. An uninstall wizard opens; it asks whether to also delete your data (off by default). Or, from an administrator prompt:
"%ProgramFiles%\RaftDB\raftdb-setup.exe" --uninstall /SThis stops the programs and removes the startup tasks, the Add/Remove Programs entry and the program folder. The data stays in %ProgramData%\RaftDB so a later install finds it. Add --purge to delete the data folder as well; that cannot be undone.
Where things are#
| What | Where |
|---|---|
| Programs | %ProgramFiles%\RaftDB\versions\<version> (raftdb-server.exe, raftdb-mysql.exe, raftdb-mssql.exe, raftdb-pg.exe, raftdb-bolt.exe, the tools raftdb-watch.exe, raftdb-dump.exe, the Studio and manifest.json); %ProgramFiles%\RaftDB\current.txt names the version that runs, and raftdb-setup.exe (which starts the programs and removes them) stays in %ProgramFiles%\RaftDB itself. An installation made with --flat, or by a version before 0.0.5, has the programs in %ProgramFiles%\RaftDB itself; raftdb-setup.exe --migrate-layout moves such an installation to the version layout (see Upgrades). |
| Summary with password | %ProgramData%\RaftDB\install-summary.txt (Administrators only); it names the version folder |
| Licences of the code inside | licenses\THIRD-PARTY-NOTICES.txt in the version folder (a flat installation: %ProgramFiles%\RaftDB\licenses\; Linux: /opt/raftdb/current/licenses/); also at /third-party-notices.txt on this site |
| Error reports choice | %ProgramData%\RaftDB\error-reports.conf |
| Server settings | %ProgramData%\RaftDB\raftdb.conf; the MySQL program's settings are in mysql.conf next to it |
| Data | %ProgramData%\RaftDB\db (the graph in graph) |
| Logs | %ProgramData%\RaftDB\logs\<program>.log |
| Start and stop by hand | schtasks /Run /TN "Raft DB raftdb-mysql" and schtasks /End /TN "Raft DB raftdb-mysql" (administrator) |
The whole %ProgramData%\RaftDB folder is open to Administrators and the system only, because it holds the passwords. To change a port later, run the setup again with --port NAME=N; it updates the settings of every program that needs the new number.
Install on Linux#
There is one Linux installer, RaftDBSetup-<version>-linux.sh. It works on x86-64 and ARM64 machines and picks the right build by itself. Check the download with its .sha256 file, then run it as root:
sudo sh RaftDBSetup-<version>-linux.sh --print # shows the plan, changes nothing: run this first
sudo sh RaftDBSetup-<version>-linux.sh # installs(Or chmod +x it and run sudo ./RaftDBSetup-<version>-linux.sh.) It numbers its steps, checks the files it unpacks, and ends with a short summary box. Started from a terminal with no options it asks the same two questions as the Windows wizard, both with the answer no as default: allow other computers (LAN), and send error reports. Options such as --lan, --no-lan, --error-reports, --no-error-reports, --uninstall and --print are passed on to the installer inside, and then it asks nothing. To choose the admin password instead of getting a random one, set the environment variable RAFTDB_ADMIN_PASSWORD (or give --admin-password-file FILE); the Linux installer has no setup types, product choice or users file. It uses systemd units, keeps the settings in /etc/raftdb, the data in /var/lib/raftdb and the programs in /opt/raftdb. It has not been tested yet on every distribution: use --print first.