Skip to content

Linux Deployment ​

Run your Kittox application natively on Linux x86-64, compiled with the Delphi Linux compiler (dcclinux64, Delphi Enterprise or Architect).

Work in progress

Linux support is new. The framework test suite and the HelloKitto example run on Ubuntu 24.04 with SQL Server through FireDAC; other databases and the remaining examples are being verified.

The .dpr file ​

No separate project: the standalone .dpr you already have (the one using Kitto.Vcl.Start) starts headless on Linux, since there is no VCL and no Windows service there. Kitto.Console.Start works too.

pascal
program MyApp;
uses
  Kitto.Vcl.Start,
  Controllers, Rules, UseKitto;
begin
  TKStart.Start;
end.

In UseKitto.pas, put the Windows-only units inside {$IFDEF MSWINDOWS}: ADO (EF.DB.ADO, Kitto.Tool.ADO), the DBExpress drivers (Data.DBXMSSQL, Data.DBXFirebird, Data.DBXOracle) and Kitto.Tool.DebenuQuickPDF. Use FireDAC for the database.

pascal
uses
  Kitto.Html.All
  {$IFDEF MSWINDOWS}
  , EF.DB.ADO
  , Kitto.Tool.ADO
  {$ENDIF}
  , EF.DB.FD
  , FireDAC.Phys.MSSQL, FireDAC.Phys.MSSQLMeta
  ...

Starting and stopping ​

The server runs until it receives SIGTERM (what systemctl stop sends), SIGINT (Ctrl+C) or SIGHUP, then stops cleanly: requests in progress end and the sessions are closed.

The log goes to the standard output (the Log/Console endpoint is on by default on Linux; set Log/Console/IsEnabled: False to turn it off). Under systemd that is the journal.

Command line: -c <file> picks the configuration file, -home <path> the application Home.

Folder layout ​

The executable lives in the application Home; the framework resources (the KittoX Home folder) are found automatically three levels up, the same layout as an IIS deployment:

/srv/kittox/Home/                    KittoX system Home
/srv/kittox/App/MyApp/Home/          application Home
/srv/kittox/App/MyApp/Home/MyApp     executable

Alternatively set the KITTOX_HOME environment variable to the folder that contains the KittoX Home.

Case-sensitive file system

Linux file systems tell Views from views. File names in the metadata must match the files on disk exactly, which Windows never checks.

systemd service ​

ini
# /etc/systemd/system/kittox-myapp.service
[Unit]
Description=KittoX application MyApp
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=kittox
WorkingDirectory=/srv/kittox/App/MyApp/Home
ExecStart=/srv/kittox/App/MyApp/Home/MyApp
TimeoutStopSec=30
Restart=on-failure
RestartSec=5
NoNewPrivileges=true
PrivateTmp=true

[Install]
WantedBy=multi-user.target
bash
sudo systemctl daemon-reload
sudo systemctl enable --now kittox-myapp
journalctl -u kittox-myapp -f        # log
sudo systemctl stop kittox-myapp     # clean stop

Database clients ​

FireDAC loads the client libraries of the distribution. On Ubuntu 24.04:

DatabasePackage
SQL Servermsodbcsql18 (Microsoft repository) + unixodbc
PostgreSQLlibpq5
Firebirdlibfbclient2 + firebird-dev

FireDAC loads the Firebird client as libfbclient.so, without a version number, and on Ubuntu that name comes only with firebird-dev (otherwise: [FireDAC][Phys][FB]-314. Cannot load vendor library).

The LDAP authenticator (Kitto.Auth.LDAP) uses OpenLDAP, package libldap2. Unlike Windows, OpenLDAP checks the server certificate on UseSSL: True (ldaps://): a self-signed directory certificate must be trusted by the system.

ICU (libicu) is required as well: the Delphi RTL uses it, and KittoX uses it to normalize passwords exactly as Windows does, so hashes created on Windows verify on Linux.

HTTPS ​

Put a reverse proxy (nginx, Apache) in front for TLS, see Proxy: the Indy server needs OpenSSL 1.0.x, which current distributions no longer ship.

Not available on Linux ​

ADO (and the Excel import/export through ACE OLEDB), the DBExpress drivers, Debenu Quick PDF, MSXML/XSL, ReportBuilder, the httpsys server engine (Indy is used instead, with a message in the log), the desktop GUI and the Windows service.

See also ​

Released under Apache License, Version 2.0.