Database Setup
NetXMS server stores all configuration, collected data, events, and alarms in a relational database. This page covers database preparation for each supported engine.
Choosing a Database
| Database | Advantages | Considerations |
|---|---|---|
PostgreSQL |
Recommended. Best overall performance, free, excellent tooling. |
Default choice for new deployments. |
TimescaleDB |
PostgreSQL extension optimized for time-series data. Best for large-scale deployments. |
Requires separate TimescaleDB installation. |
MySQL / MariaDB |
Widely available, easy to set up. |
Requires InnoDB engine. Use |
MS SQL Server |
Native on Windows, integrates with existing Microsoft infrastructure. |
License costs. Use the ODBC driver on Linux. |
Oracle |
Enterprise environments with existing Oracle infrastructure. |
Requires Oracle client libraries. |
SQLite |
Zero setup. Built into the server. |
Evaluation only. Not suitable for production. |
| For new deployments, use PostgreSQL. For large environments (10,000+ nodes or 500,000+ DCIs), consider TimescaleDB for improved write performance and automatic data retention. |
PostgreSQL Setup
Create Database and User
sudo -u postgres psql
CREATE USER netxms WITH PASSWORD 'your_secure_password';
CREATE DATABASE netxms_db OWNER netxms;
\q
Configure Authentication
Ensure the PostgreSQL pg_hba.conf allows connections from the NetXMS server:
# TYPE DATABASE USER ADDRESS METHOD
host netxms_db netxms 127.0.0.1/32 scram-sha-256
host netxms_db netxms ::1/128 scram-sha-256
Reload PostgreSQL after changing pg_hba.conf:
sudo systemctl reload postgresql
TimescaleDB Setup
TimescaleDB extends PostgreSQL with automatic time-series partitioning. NetXMS detects TimescaleDB and automatically creates hypertables for performance data.
Install TimescaleDB
Follow the official TimescaleDB installation guide for your platform, then enable the extension:
CREATE DATABASE netxms_db OWNER netxms;
\c netxms_db
CREATE EXTENSION IF NOT EXISTS timescaledb;
Server Configuration
The configuration file is identical to PostgreSQL:
DBDriver = pgsql.ddr
DBServer = localhost
DBName = netxms_db
DBLogin = netxms
DBPassword = your_secure_password
Initialize the database with nxdbmgr init tsdb to create the TimescaleDB schema.
When run interactively without a type argument, nxdbmgr init will ask whether to create a plain PostgreSQL or TimescaleDB schema; after initialization the schema type is recorded in the database and used automatically.
|
MySQL / MariaDB Setup
Create Database and User
sudo mysql
CREATE DATABASE netxms_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'netxms'@'localhost' IDENTIFIED BY 'your_secure_password';
GRANT ALL PRIVILEGES ON netxms_db.* TO 'netxms'@'localhost';
FLUSH PRIVILEGES;
\q
Use the utf8mb4 character set. The older utf8 charset in MySQL only supports 3-byte characters and may cause issues with certain object names.
|
Required MySQL Settings
Add these settings to your MySQL configuration (/etc/mysql/mysql.conf.d/mysqld.cnf or equivalent):
[mysqld]
innodb_buffer_pool_size = 1G
innodb_log_file_size = 256M
max_allowed_packet = 32M
Adjust innodb_buffer_pool_size based on available memory (typically 50-70% of RAM dedicated to the database server).
Microsoft SQL Server Setup
Create Database and Login
Using SQL Server Management Studio or sqlcmd:
CREATE DATABASE netxms_db;
GO
CREATE LOGIN netxms WITH PASSWORD = 'your_secure_password';
GO
USE netxms_db;
CREATE USER netxms FOR LOGIN netxms;
EXEC sp_addrolemember 'db_owner', 'netxms';
GO
Server Configuration (Windows, native driver)
DBDriver = mssql.ddr
DBServer = localhost
DBName = netxms_db
DBLogin = netxms
DBPassword = your_secure_password
Server Configuration (Linux, ODBC driver)
On Linux, use the ODBC driver with FreeTDS or the Microsoft ODBC Driver for SQL Server:
DBDriver = odbc.ddr
DBServer = netxms_mssql_dsn
DBName = netxms_db
DBLogin = netxms
DBPassword = your_secure_password
Configure the DSN in /etc/odbc.ini:
[netxms_mssql_dsn]
Driver = ODBC Driver 18 for SQL Server
Server = mssql-server.example.com
Port = 1433
SQL Server Express Setup
SQL Server Express is a free edition of Microsoft SQL Server suitable for small to medium NetXMS deployments. The setup procedure depends on whether SQL Server is local or remote and which authentication mode is used.
Local SQL Server Express with Mixed Authentication
-
Install Microsoft SQL Server Express with default options
-
Enable mixed authentication mode (see Microsoft documentation)
-
Restart the SQL Server service after changing the authentication mode
-
Run the NetXMS Server installer. When prompted for database information, use the following settings:
Server type
MS SQL
Server name
localhost\SQLEXPRESSDatabase name
netxms(or any valid name)Login name
netxms(or any valid account name)Password
A password that meets Windows password policy requirements
Create database and database user
Checked
DBA login name
*(uses current Windows user credentials)DBA password
Leave empty
This assumes the currently logged-in user has DBA access to the SQL Server instance, which is the case if SQL Server was installed by the same user. Alternatively, enable the
saaccount in SQL Server and use it as the DBA login.
Local SQL Server Express with Windows Authentication
If mixed authentication is not an option:
-
Install Microsoft SQL Server Express with default options
-
Open SQL Server Management Studio and create a new database with the default owner (set to the currently logged-in administrator user)
-
Run the NetXMS Server installer. On the "Select additional tasks" page, uncheck "Start NetXMS Core service"
-
When prompted for database information:
Server type
MS SQL
Server name
localhost\SQLEXPRESSDatabase name
The database name from step 2
Login name
*(uses Windows authentication)Password
Leave empty
Create database and database user
Unchecked
-
After installation, open the Services console, find the "NetXMS Core" service, and configure it to log in as the administrator user (the same user who created the database)
-
Start the NetXMS Core service
Remote SQL Server Express with SQL Authentication
Prerequisites:
-
TCP/IP is enabled in SQL Server Configuration Manager under Network Protocols
-
TCP/IP is configured to use a fixed port (not dynamic)
-
A firewall rule allows incoming connections on the SQL Server TCP port
-
Mixed authentication mode is enabled on the SQL Server
-
On the SQL Server host, create a database and login using SQL Server Management Studio or
sqlcmd:CREATE DATABASE netxms_db; GO CREATE LOGIN netxms WITH PASSWORD = 'your_secure_password'; GO USE netxms_db; CREATE USER netxms FOR LOGIN netxms; EXEC sp_addrolemember 'db_owner', 'netxms'; GO -
On the NetXMS server host, run the installer with:
Server type
MS SQL
Server name
sqlserver.example.com\SQLEXPRESS(replace with actual hostname)Database name
netxms_dbLogin name
netxmsPassword
The password from step 1
Create database and database user
Unchecked
-
Remote SQL Server Express with Domain Authentication
Prerequisites:
-
Both hosts are members of the same Active Directory domain
-
TCP/IP is enabled and configured with a fixed port on the SQL Server
-
A firewall rule allows incoming connections on the SQL Server TCP port
-
On the SQL Server host, create a database and grant access to the domain account that will run the NetXMS Core service:
CREATE DATABASE netxms_db; GO USE netxms_db; CREATE USER [DOMAIN\ServiceAccount] FOR LOGIN [DOMAIN\ServiceAccount]; EXEC sp_addrolemember 'db_owner', 'DOMAIN\ServiceAccount'; GO -
On the NetXMS server host, run the installer. On the "Select additional tasks" page, uncheck "Start NetXMS Core service"
-
When prompted for database information:
Server type
MS SQL
Server name
sqlserver.example.com\SQLEXPRESS(replace with actual hostname)Database name
netxms_dbLogin name
*(uses Windows authentication)Password
Leave empty
Create database and database user
Unchecked
-
After installation, configure the NetXMS Core service to log in as the domain account that was granted database access
-
Start the NetXMS Core service
-
Oracle Database Setup
Create Tablespace and User
CREATE TABLESPACE netxms_data
DATAFILE '/opt/oracle/oradata/netxms_data.dbf' SIZE 1G AUTOEXTEND ON;
CREATE USER netxms IDENTIFIED BY your_secure_password
DEFAULT TABLESPACE netxms_data
QUOTA UNLIMITED ON netxms_data;
GRANT CONNECT, RESOURCE TO netxms;
GRANT CREATE SESSION TO netxms;
GRANT CREATE TABLE TO netxms;
GRANT CREATE SEQUENCE TO netxms;
SQLite Setup (Evaluation Only)
SQLite requires no separate database setup. The server creates the database file automatically.
DBDriver = sqlite.ddr
DBServer = /var/lib/netxms/netxms.db
DBName =
DBLogin =
DBPassword =
| SQLite is intended for evaluation only. It does not support concurrent writes and will cause performance problems under production load. Do not use SQLite if you plan to monitor more than a handful of nodes. |
Configuration File Reference
| Parameter | Description |
|---|---|
|
Database driver library name (e.g., |
|
Database server address. For PostgreSQL/MySQL, use hostname or IP. For Oracle, use connect string. For SQLite, use file path. |
|
Database or schema name. |
|
Database user name. |
|
Database user password, either plain text or obfuscated with |
|
Database schema name (PostgreSQL and Oracle only, if not using default schema). |
Use nxencpasswd to generate an obfuscated password for the configuration file instead of storing the password in plain text:
|
nxencpasswd <login> [<password>]
Where <login> is the database login name and <password> is the database password. If <password> is omitted, you will be prompted to enter it. Put the output into the DBPassword parameter in your configuration file.
Database Initialization
After configuring the server, initialize the database schema:
nxdbmgr init
nxdbmgr init generates a random password for the admin user and prints it to the terminal — save it, it is shown only once.
To set a specific password instead, pass -p <password>.
With no argument, nxdbmgr init deduces the database type from the configured database driver.
For the pgsql and odbc drivers, where the driver name is ambiguous, it asks interactively which schema type to create (for PostgreSQL: plain PostgreSQL or TimescaleDB); in non-interactive environments, specify the type explicitly (e.g., nxdbmgr init tsdb).
Supported database type names:
| Type | Database |
|---|---|
|
PostgreSQL |
|
TimescaleDB |
|
MySQL / MariaDB |
|
Microsoft SQL Server |
|
Oracle Database |
|
SQLite |
The nxdbmgr tool reads the same configuration file as the server (/etc/netxmsd.conf).
With the -C <dba_login>/<dba_password> option, nxdbmgr init can create the database and user for you before initialization, using the provided DBA credentials.
|