---
title: "Installing and running CoraDB on Linux and Windows"
description: "Install CoraDB on 64-bit Linux (.sh, RPM, tar.gz) or Windows (installer, zip), set the environment and create your first database."
url: "https://www.coradb.ai/manual/install.html"
markdown_url: "https://www.coradb.ai/manual/markdown/install.md"
product: "CoraDB"
version: "1.0"
keywords: "install coradb, coradb linux install, coradb windows install, coradb rpm, coradb tar.gz, coradb system requirements, coradb service start, coradb autostart, .coradb.sh"
---

# Installing and running CoraDB on Linux and Windows

## System requirements

| Item | Requirement |
|---|---|
| Operating system | 64-bit Linux (glibc 2.3.4 or later) or 64-bit Windows |
| Memory | 1 GB or more |
| Disk space | 500 MB for the software, plus the space of your databases (about 1.5 GB for a database created with the default volume sizes) |
| Java | A JRE or JDK, only for [Java stored procedures](https://www.coradb.ai/manual/sql/jsp.html) |

On Linux, CoraDB also needs these libraries:

- ncurses (`rpm -q ncurses`). CoraDB uses version 5 of the Curses library; on systems with a newer version, install the `ncurses-compat-libs` package.
- libgcrypt (`rpm -q libgcrypt`)
- libstdc++ (`rpm -q libstdc++`)

Check also that `/etc/hosts` maps the host name to the right IP address; otherwise the database server cannot start.

CoraDB and its drivers can be downloaded from <https://www.coradb.ai/downloads>.

## Compatibility

- **Drivers**: applications use the [drivers](https://www.coradb.ai/manual/api.html) of the same CoraDB version as the server, to have all the features of that version.
- **Broker and server**: when the broker and the database server run on different machines, they must have the same CoraDB version; only the patch level may differ. Different operating systems are fine (for example a Linux server and a Windows broker).
- **Databases**: a database created with another major or minor version must be migrated; see [Upgrade](https://www.coradb.ai/manual/upgrade.html).

## Installing and running CoraDB on Linux

### With the self-extracting installer (.sh)

Run the installer as the Linux user who will own CoraDB:

```bash
sh CoraDB-1.0.1.xxxx-Linux.x86_64.sh
```

The installer shows the license and asks you to accept it, whether to install into a subdirectory named after the package or directly into the current directory, and to confirm that the broker and server versions will match. It then unpacks CoraDB and writes the environment script `~/.coradb.sh` (and `~/.coradb.csh`), which it adds to your shell profile. Load the environment and start CoraDB:

```bash
. ~/.coradb.sh
coradb service start
```

The script sets `CORADB`, `CORADB_DATABASES`, `PATH` and `LD_LIBRARY_PATH`; see [Environment variables](https://www.coradb.ai/manual/env.html). It is run automatically at your next login.

`coradb service start` starts the processes listed in the `[service]` section of `coradb.conf`: by default the master process, the brokers and the CoraDB Manager Server (CMS), plus the database servers listed there. Check the processes with:

```bash
ps -ef | grep cora_
```

Among others you see `cora_master`, two `cora_broker` processes, and the CAS processes of each broker, named `query_editor_cora_cas_N` and `broker1_cora_cas_N`.

### With RPM

```bash
rpm -Uvh coradb-1.0.1.xxxx-Linux.x86_64.rpm
```

The RPM installs CoraDB in `/opt/coradb`, creates the Linux group and user `coradb`, and installs the environment scripts `coradb.sh` and `coradb.csh` in `/etc/profile.d`. Log in as `coradb` and start CoraDB with `coradb service start`.

- Respect the RPM dependencies; a package installed with `--nodeps` may not run.
- Removing the RPM does not remove the `coradb` account or the databases created afterwards; remove them manually if needed.

### With a tar.gz archive

1. Extract the archive in the installation directory:

   ```bash
   tar xvfz CoraDB-1.0.1.xxxx-Linux.x86_64.tar.gz -C /home/coradb
   ```

2. Add the environment to your shell profile (for example `~/.bash_profile`), and create the `$CORADB_DATABASES` directory:

   ```bash
   export CORADB=/home/coradb/CoraDB
   export CORADB_DATABASES=$CORADB/databases
   export PATH=$CORADB/bin:$PATH
   export LD_LIBRARY_PATH=$CORADB/lib:$LD_LIBRARY_PATH
   export CLASSPATH=$CORADB/jdbc/coradb_jdbc.jar:$CLASSPATH
   ```

3. Create a database:

   ```bash
   mkdir -p $CORADB_DATABASES/testdb
   cd $CORADB_DATABASES/testdb
   coradb createdb --db-volume-size=128M --log-volume-size=128M testdb en_US.utf8
   ```

### Starting CoraDB at boot

The init script `coradb` is in `$CORADB/share/init.d` (installed in `/etc/init.d` by the RPM). Set the variable `CORADB_USER` in the script to the Linux user who owns CoraDB, copy it to `/etc/init.d` if needed, and enable it with your system's service tools (`chkconfig`, `systemctl enable`, …).

To start database servers together with the service, list them in the `[service]` section of `$CORADB/conf/coradb.conf`:

```ini
[service]
service=server,broker
server=testdb,e-commerce
```

`service` lists the processes that `coradb service start` starts (any of `server`, `broker`, `manager`, `javasp`; the default is `server,broker,manager`), and `server` the databases. See [service](https://www.coradb.ai/manual/admin/config_other.html#service).

### Upgrading an existing installation

When the target directory already contains CoraDB, the installer asks before overwriting it and its configuration files; overwritten configuration files are kept with the extension `.bak`. Stop CoraDB (`coradb service stop`) before installing. To move databases to a new version, see [Upgrade](https://www.coradb.ai/manual/upgrade.html).

### Configuration

The configuration files are in `$CORADB/conf`:

- `coradb.conf`: the database server parameters, such as memory, threads and the master port `coradb_port_id` (default 1523). See [System parameters](https://www.coradb.ai/manual/admin/config.html).
- `cm.conf`: CMS; its port `cm_port` defaults to 8001.
- `coradb_broker.conf`: the brokers, their ports (`BROKER_PORT`, default 30000 for `query_editor` and 33000 for `broker1`), number of CAS processes and SQL logs. See [Broker configuration](https://www.coradb.ai/manual/admin/config_broker.html).

If a firewall is active, open the ports listed in [Default ports for CoraDB](https://www.coradb.ai/manual/env.html#default-ports-for-coradb).

## Installing and running CoraDB on Windows

### With the installer

Run the installer on 64-bit Windows, choose the installation directory, and finish the installation. The installer sets the environment variables (`CORADB`, `CORADB_DATABASES`, `Path`), registers the Windows service **CORADBService**, which starts CoraDB when Windows starts, and installs the CoraDB Service Tray, an icon in the notification area to start and stop CoraDB.

To keep CoraDB from starting with Windows, set the startup type of **CORADBService** to *Manual* in *Control Panel > Administrative Tools > Services*.

If the Service Tray does not start with Windows, check that the *Task Scheduler* service is running and that the Service Tray is in the *Startup* folder.

To install a new version, exit the Service Tray to stop CoraDB and uninstall the old version. When asked whether to delete the existing databases and configuration files, answer **No**. See [Upgrade](https://www.coradb.ai/manual/upgrade.html) for migrating databases.

The configuration files are in `%CORADB%\conf`, as on Linux. On Windows, `coradb_broker.conf` also has **APPL_SERVER_PORT**, the first port used by the CAS processes of a broker; with `APPL_SERVER_PORT=35000` and 50 CAS processes (**MAX_NUM_APPL_SERVER**), the CAS processes listen on ports 35000 to 35049. Without it, they use `BROKER_PORT` + 1 and up. See [Parameter by broker](https://www.coradb.ai/manual/admin/config_broker.html#parameter-by-broker).

### With a zip archive

1. Extract the archive, for example to `C:\CoraDB`, and create a directory for the databases.
2. In *System Properties > Advanced > Environment Variables*, add the system variables:

   ```text
   CORADB = C:\CoraDB
   CORADB_DATABASES = %CORADB%\databases
   ```

   and add `%CORADB%\bin` to **Path** and `%CORADB%\jdbc\coradb_jdbc.jar` to **CLASSPATH**.
3. Open a command prompt and create a database:

   ```bat
   cd C:\CoraDB\databases
   md testdb
   cd testdb
   coradb createdb --db-volume-size=128M --log-volume-size=128M testdb en_US.utf8
   ```

4. Register CoraDB as a Windows service, so that it starts with Windows:

   ```bat
   C:\CoraDB\bin\ctrlService.exe -i C:\CoraDB\bin
   C:\CoraDB\bin\ctrlService.exe -start
   ```

   `ctrlService.exe -stop` stops the service and `ctrlService.exe -u` removes it.
5. List the databases to start with the service in the `[service]` section of `C:\CoraDB\conf\coradb.conf`, as on Linux.

To use the CoraDB Service Tray with a zip installation, put a shortcut to `C:\CoraDB\bin\CoraDB_Service_Tray.exe` in the *Startup* folder and create these registry string values (`REG_SZ`) under `HKEY_LOCAL_MACHINE\SOFTWARE\CoraDB`:

| Key | Name | Data |
|---|---|---|
| `CORADB` | `ROOT_PATH` | `C:\CoraDB` |
| `cmserver` | `ROOT_PATH` | `C:\CoraDB` |

The tray icon appears after the next restart of Windows.
