Overview
IceWarp strongly recommends using MariaDB instead of the default SQLite database for production environments. MariaDB provides better performance, scalability, and supports foreign keys, which SQLite lacks.
Important Note:
For larger deployments with a high user base, IceWarp recommends using Percona Server for MySQL instead of MariaDB. Percona offers enhanced performance, better scalability, and additional enterprise features that are beneficial for large-scale installations. This guide focuses on MariaDB, which is suitable for small to medium deployments. If you're planning a large deployment, consider consulting IceWarp documentation for Percona-specific configuration.
Prerequisites
- Root or sudo access to your Red Hat 9 server
- IceWarp EPOS installed (or ready to configure during installation)
- Basic understanding of database operations
System Requirements
MariaDB resource requirements depend on your expected user base and usage patterns:
Up to 1000 Users
Bare Minimum:
- CPU: 2 cores minimum
- RAM: 8 GB
- Storage: 60 GB HDD minimum (SSD recommended)
Recommended for Production:
- CPU: 4-6 cores
- RAM: 16-24 GB (allows proper buffer pool sizing at 70-80% of RAM = 11-19GB for innodb_buffer_pool_size)
- Storage: 120+ GB SSD (NVMe preferred)
1000-5000 Users
Bare Minimum:
- CPU: 4+ cores
- RAM: 16-32 GB
- Storage: 100+ GB SSD recommended
Recommended for Production:
- CPU: 8-12 cores
- RAM: 32-48 GB (allows 22-38GB buffer pool)
- Storage: 250+ GB NVMe SSD with high IOPS
Above 5000 Users
Bare Minimum:
- CPU: 8+ cores
- RAM: 32+ GB
- Storage: 200+ GB SSD
Recommended for Production:
- CPU: 16+ cores
- RAM: 64-128 GB (allows 45-102GB buffer pool)
- Storage: 500+ GB NVMe SSD in RAID 10
- Strongly Recommended: Clustered SQL solution for high availability
- Consider: Percona Server for MySQL for enhanced performance and better scalability
Important Notes:
- These recommendations assume a dedicated database server separate from the IceWarp application server
- If MariaDB runs on the same server as IceWarp, combine these requirements with IceWarp's resource needs (4 CPU, 8 GB RAM minimum for the application)
- Usage patterns vary significantly: Heavy WebClient users require fewer resources than organisations with multiple desktop clients syncing frequently
- NVMe SSD storage is highly recommended for optimal database IOPS performance
- Consider RAID 10 for larger deployments to balance performance and redundancy
- Monitor your actual usage and adjust - these are starting points, not fixed requirements
- For personalised recommendations based on your specific scenario, contact IceWarp Support
Step 1: Install MariaDB
Install MariaDB server using the DNF package manager:
sudo dnf install mariadb-serverPress y then Enter to confirm the installation.
Step 2: Start and Enable MariaDB Service
Start the MariaDB service:
sudo systemctl start mariadbVerify that the service is running:
sudo systemctl status mariadbYou should see active (running) in the output.
Enable MariaDB to start automatically on boot:
sudo systemctl enable mariadbStep 3: Secure MariaDB Installation
Run the security script to improve MariaDB security:
sudo mysql_secure_installationFollow the prompts:
- Press Enter when asked for the current root password (there is none by default)
- Type Y to set a root password, then enter and confirm your new password
- Type Y to remove anonymous users
- Type Y to disallow remote root login
- Type Y to remove the test database
- Type Y to reload privilege tables
Important: Remember this root password - you'll need it for database administration.
Step 4: Configure MariaDB for IceWarp
4.1 Edit MariaDB Configuration
Edit the MariaDB configuration file:
sudo nano /etc/my.cnfOr if using my.cnf.d directory:
sudo nano /etc/my.cnf.d/mariadb-server.cnfAdd the following configuration under the [mysqld] section. This example is optimized for a server with adequate resources (adjust based on your server specifications):
[mysqld]
# Basic Settings
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mariadb/mariadb.log
pid-file=/run/mariadb/mariadb.pid
# Disable SSL (IceWarp doesn't support SSL connections yet)
ssl=0
# Character Set and Collation
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
# InnoDB Settings (adjust based on your server's RAM)
innodb_buffer_pool_size=4G
# Set to ~70-80% of available RAM
innodb_log_file_size=512M
innodb_log_buffer_size=128M
innodb_flush_log_at_trx_commit=2
innodb_file_per_table=1
innodb_flush_method=O_DIRECT
# Performance Settings (adjust based on CPU cores)
innodb_read_io_threads=4 # Set to number of CPU cores
innodb_write_io_threads=4 # Set to number of CPU cores
innodb_buffer_pool_instances=4 # Recommended: same as buffer pool size in GB
# Connection Settings
max_connections=200
max_allowed_packet=256M
# Query Cache (optional, can improve performance)
query_cache_type=1
query_cache_size=64MImportant Notes:
- innodb_buffer_pool_size: Set this to 70-80% of your total RAM for dedicated database servers
- innodb_read/write_io_threads: Set to match your CPU core count
- SSL disabled: IceWarp does not yet support SSL connections to MariaDB
Save and exit (Ctrl+X, then Y, then Enter in nano).
4.2 Remove Old InnoDB Files (If Reconfiguring)
If you're modifying an existing MariaDB installation, you may need to remove old InnoDB files:
sudo systemctl stop mariadb
sudo rm -rf /var/lib/mysql/ib_buffer_pool
sudo rm -rf /var/lib/mysql/ibdata1
sudo rm -rf /var/lib/mysql/ib_logfile0
sudo rm -rf /var/lib/mysql/ib_logfile1Warning: Only do this on a fresh MariaDB installation or after backing up your data!
4.3 Restart MariaDB
Restart MariaDB to apply the configuration changes:
sudo systemctl restart mariadbVerify it started successfully:
sudo systemctl status mariadbStep 5: Create IceWarp Databases
Log into MariaDB as root:
mysql -u root -pEnter the root password you set earlier.
Create the required databases with proper character set and collation:
CREATE DATABASE accounts DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE groupware DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE webclient DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE dircache DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE eas DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE antispam DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE asreports DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;Note: You can choose different collations based on your location. See MariaDB collations documentation for options.
Step 6: Create IceWarp Database User
Create a dedicated user for IceWarp (replace icewarp_server_ip with your IceWarp server's IP address, or use localhost if MariaDB is on the same server):
CREATE USER 'icewarp'@'localhost' IDENTIFIED BY 'your_secure_password';Or for remote access:
CREATE USER 'icewarp'@'icewarp_server_ip' IDENTIFIED BY 'your_secure_password';Grant all privileges on IceWarp databases to this user:
GRANT ALL PRIVILEGES ON accounts.* TO 'icewarp'@'localhost';
GRANT ALL PRIVILEGES ON groupware.* TO 'icewarp'@'localhost';
GRANT ALL PRIVILEGES ON webclient.* TO 'icewarp'@'localhost';
GRANT ALL PRIVILEGES ON dircache.* TO 'icewarp'@'localhost';
GRANT ALL PRIVILEGES ON eas.* TO 'icewarp'@'localhost';
GRANT ALL PRIVILEGES ON antispam.* TO 'icewarp'@'localhost';
GRANT ALL PRIVILEGES ON asreports.* TO 'icewarp'@'localhost';
FLUSH PRIVILEGES;For remote access, replace 'localhost' with your IceWarp server IP in all GRANT statements.
Exit MariaDB:
EXIT;Step 7: Configure Firewall (If MariaDB is on a Separate Server)
If MariaDB runs on a different server than IceWarp, open the MariaDB port:
sudo firewall-cmd --permanent --add-port=3306/tcp
sudo firewall-cmd --reloadSecurity Note: Consider restricting access to only the IceWarp server IP:
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="icewarp_server_ip" port protocol="tcp" port="3306" accept'
sudo firewall-cmd --reloadStep 8: Verify MariaDB Installation
Test the connection with the IceWarp user:
mysql -u icewarp -pEnter the password you created. If you can log in successfully, MariaDB is ready.
Check the databases:
SHOW DATABASES;
EXIT;Step 9: Migrate IceWarp to MariaDB
9.1 Using IceWarp Administration Console
- Log into the IceWarp Remote Administration Console
- Navigate to System → Storage → Databases
-
For each database type (GroupWare, WebClient, Directory Cache, etc.):
Click DB Settings
Enter connection details:
- DB Type: MySQL/MariaDB
- Host: localhost (or IP address if remote)
- Port: 3306
- Database name: (e.g., groupware, webclient, etc.)
- Username: icewarp
- Password: your_secure_password
Click Test Connection
Click Create Tables
Click Migrate to transfer data from SQLite
9.2 Migrating Accounts Database
The accounts database requires special handling:
- Navigate to System → Storage → Accounts
- If accounts are stored on File System, click DB Settings
- Configure the database connection:
- Host: localhost (or IP if remote)
- Port: 3306
- Database: accounts
- Username: icewarp
- Password: your_secure_password
- Click Test Connection
- Click Create Tables
- When prompted, select Yes to migrate accounts to the database
- After migration completes, switch from File System to Database storage mode
Step 10: Verify Migration
After migrating all databases:
- Restart IceWarp services:
sudo systemctl restart icewarp- Check IceWarp logs for any database connection errors:
tail -f /opt/icewarp/logs/server.log- Test logging into IceWarp WebClient
- Verify all functionality works correctly
Performance Tuning
Monitor and Adjust
After running IceWarp with MariaDB for some time, monitor performance and adjust settings:
# Check MariaDB status
mysql -u root -p -e "SHOW STATUS;"
# Check InnoDB buffer pool usage
mysql -u root -p -e "SHOW ENGINE INNODB STATUS\G"Consider using MySQLTuner for optimization recommendations:
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl
chmod +x mysqltuner.pl
sudo ./mysqltuner.plBackup Recommendations
Regular Database Backups
Create automated backups of your IceWarp databases:
#!/bin/bash
# Simple backup script
BACKUP_DIR="/backup/mariadb"
DATE=$(date +%Y%m%d_%H%M%S)
mkdir -p $BACKUP_DIR
mysqldump -u icewarp -p'your_password' accounts > $BACKUP_DIR/accounts_$DATE.sql
mysqldump -u icewarp -p'your_password' groupware > $BACKUP_DIR/groupware_$DATE.sql
mysqldump -u icewarp -p'your_password' webclient > $BACKUP_DIR/webclient_$DATE.sql
mysqldump -u icewarp -p'your_password' antispam > $BACKUP_DIR/antispam_$DATE.sql
# Keep only last 7 days of backups
find $BACKUP_DIR -name "*.sql" -mtime +7 -deleteAdd this to crontab for daily execution:
crontab -e
# Add: 0 2 * * * /path/to/backup_script.shTroubleshooting
Common Issues
Connection Failed:
- Verify MariaDB is running: sudo systemctl status mariadb
- Check credentials are correct
- Ensure firewall allows connections
- Verify user has proper permissions
SSL Connection Error:
- Ensure ssl=0 is set in my.cnf under [mysqld]
- Restart MariaDB after configuration changes
Performance Issues:
- Adjust innodb_buffer_pool_size based on available RAM
- Increase innodb_io_threads if you have more CPU cores
- Use MySQLTuner for specific recommendations
Migration Errors:
- Ensure all databases are created before migration
- Stop IceWarp watchdog services if migration fails
- Check IceWarp logs for specific error messages
Additional Resources
Comments
0 comments
Article is closed for comments.