Installing on Windows
This section describes how to install OpenKM manually on Windows. An OpenKM Installer tool automates most of these steps; refer to the Using the installer documentation for more information.
Preliminaries
If you plan to configure OpenKM in cluster or sharding mode, read the following documentation before starting the installation:
Check that you have enough disk space.
The following tools are recommended:
- Notepad++ ? text editor
- Geany ? text editor
- mTail ? Windows program that behaves like the Unix
tailcommand
Checking the Java version
C:\> java -version
If Java is correctly installed, the name and version of the Java Virtual Machine are displayed:
openjdk version "17.0.x"
OpenJDK Runtime Environment
OpenJDK 64-Bit Server VM
OpenKM 8.2 requires Java 17. Set the JAVA_HOME variable accordingly:
setx JAVA_HOME "C:\Program Files\Java\jdk-17" /M
Install Java
Only perform these steps if Java 17 is not installed on your server.
If Java 17 is not installed on your server:
- Download it from the Microsoft website and choose the appropriate platform for your hardware and Windows version.
- Run the MSI file and follow the installation wizard.
Installing the database
If MySQL is not already installed, download the MySQL MSI Installer from MySQL Community Server and follow the installation wizard.
Installing MySQL Workbench is also recommended if you do not have a MySQL client tool.
Check that InnoDB is the default MySQL engine
show engines;
The output should include:
| InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
If InnoDB is not the default, modify c:\ProgramData\MySQL\MySQL Server 8.0.34\my.ini and add the following under [mysqld]:
default-storage-engine = innodb
After changing the default MySQL engine, restart the MySQL service for the change to take effect.
Create the database
CREATE DATABASE okmdb DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;
CREATE USER openkm@localhost IDENTIFIED BY 'password';
GRANT ALL ON okmdb.* TO openkm@localhost WITH GRANT OPTION;
Installing Tomcat
Unzip Tomcat-9.0.76.zip to c:\.
The Tomcat version number may vary with upgrades.
Configuring Tomcat as a service
Open a Windows terminal as administrator and register the service:
cd c:\tomcat-9.0.76\bin
service.bat install
Set the JVM parameters for the Tomcat service:
cd c:\tomcat-9.0.76\bin
openkm //US//OpenKM ++JvmOptions="-Xms1024m"
openkm //US//OpenKM ++JvmOptions="-Xmx4096m"
openkm //US//OpenKM ++JvmOptions="-XX:+UseG1GC"
openkm //US//OpenKM ++JvmOptions="-XX:+UseStringDeduplication"
openkm //US//OpenKM ++JvmOptions="-XX:+HeapDumpOnOutOfMemoryError"
openkm //US//OpenKM ++JvmOptions="-XX:HeapDumpPath=%CATALINA_HOME%"
openkm //US//OpenKM ++JvmOptions="-Djava.net.preferIPv4Stack=true"
openkm //US//OpenKM ++JvmOptions="-Dmail.mime.ignoreunknownencoding=true"
openkm //US//OpenKM ++JvmOptions="-Dfile.encoding=UTF-8"
openkm //US//OpenKM ++JvmOptions="-Dsun.jnu.encoding=UTF-8"
openkm //US//OpenKM ++JvmOptions="-Djava.awt.headless=true"
openkm //US//OpenKM ++JvmOptions="-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider"
Execute openkmw.exe as administrator to configure the service. You can also change "Startup type" to Automatic.
More information about configuring the Tomcat service on Windows: https://tomcat.apache.org/tomcat-9.0-doc/windows-service-howto.html
Check the service
From the terminal:
net start OpenKM
net stop OpenKM
From the Windows Services panel or from the openkmw tool.
Configuring environment variables
Add the bin folder to the PATH environment variable:
setx PATH "%PATH%;C:\tomcat-9.0.76\bin" /M
This can also be done through the Windows environment variables settings. The exact screens may vary depending on the Windows version.
Installing OpenKM
With Tomcat stopped, copy the OpenKM WAR file to the webapps directory:
copy openkm.war c:\tomcat-9.0.76\webapps
Install third-party software:
| Software | Required | Description |
|---|---|---|
| LibreOffice | Yes | Recommended for compatibility with Microsoft Office formats. |
| Tesseract | No | OCR engine. Download and follow the installation wizard. |
| ClamAV | No | Antivirus engine. Download and follow the installation wizard. |
| ImageMagick | No | The Tomcat bundle includes an embedded convert tool. If you install it separately, use the Q8 build (e.g., ImageMagick-6.9.x-Q8-x64-dll.exe) rather than the Q16 build, as 16-bit builds require more hardware resources. |
| Ghostscript | No | The Tomcat bundle includes an embedded Ghostscript tool. |
| An Extras.zip file is also available containing all the above software in portable editions. | ||
Starting the application
Check openkm.properties parameters
C:\> geany c:\openkm\openkm.properties
Your configuration should contain something like this:
# OpenKM Hibernate configuration values
spring.jpa.properties.hibernate.dialect=com.openkm.db.dialect.MySQL5InnoDBDialect
spring.jpa.hibernate.ddl-auto=create-only
# Initial configuration - Windows
system.libreoffice.path=C:/Program Files (x86)/LibreOffice
Ensure spring.jpa.properties.hibernate.dialect=com.openkm.db.dialect.MySQL5InnoDBDialect is enabled if your database is MySQL.
Start the application for the first time:
net start OpenKM
Use mTail (or an equivalent program) to watch the log file at c:\tomcat-9.0.76\log\openkm.log.
When the application has started, you will see lines like these in the log:
2015-07-04 18:28:10,680 [main] INFO org.apache.coyote.http11.Http11Protocol - Starting ProtocolHandler ["http-bio-0.0.0.0-8080"]
2015-07-04 18:28:10,688 [main] INFO org.apache.coyote.ajp.AjpProtocol - Starting ProtocolHandler ["ajp-bio-127.0.0.1-8009"]
2015-07-04 18:28:10,692 [main] INFO org.apache.catalina.startup.Catalina - Server startup in 41456 ms
The application will be accessible at http://YOUR_IP:8080/openkm with the default credentials: user okmAdmin, password admin. Change the password after the first login.
Enable the extensions you need (for example Live Edit and HTML Editor) in the profile Misc > Extensions selector. See Enable extensions for details.
Access from other computers
Access from other computers is blocked by default due to Windows Firewall settings. To allow access from any host, run:
netsh advfirewall firewall add rule name="OpenKM" dir=in action=allow protocol=TCP localport=8080
Additional configuration
OpenKM provides many configuration parameters. Other standard configurations include:
- Configuring Apache HTTP Reverse Proxy
- Configuring Tomcat mail
- Configuring Tomcat memory utilization
- Configuring Tomcat ports
- Configuring Tomcat SSL/TLS
- Configuring Tomcat time zone