SAP HANA Express Edition is a streamlined, in‑memory database perfect for developers, and Docker makes setup surprisingly easy. Whether you're prototyping or practicing SQL/XS Advanced, this guide covers everything: pulling the Docker image, setting up host requirements, running the container, and connecting your tools.
1. Prerequisites & Docker Setup
First, ensure Docker is installed on your Linux environment (Windows/macOS aren’t supported for SAP HANA Express).
You may need to optimize kernel settings in
/etc/sysctl.conf
:
fs.file-max=20000000
fs.aio-max-nr=262144
vm.max_map_count=135217728
net.ipv4.ip_local_port_range=40000 60999
Apply with:
sudo sysctl -p
These tweaks help HANA allocate memory and file handles correctly
en.wikipedia.org.
2. Pull the SAP HANA Docker Image
Download the official HANA Express image from Docker Hub:
docker pull saplabs/hanaexpress
Or for the XSA‑enabled version:
docker pull saplabs/hanaexpressxsa
Make sure you’re running a supported Linux distro—SUSE or CentOS are good choices.
3. Prepare the Password File
Create a JSON file (e.g.,
hxe-pass.json
) to set the
master_password
:
{
"master_password": "YourStrongPass1"
}
Set permissions and ownership so HANA can read it:
sudo mv hxe-pass.json /data/hana/
sudo chown 12000:79 /data/hana/hxe-pass.json
sudo chmod 600 /data/hana/hxe-pass.json
This secures your database password on the host.
4. Run the SAP HANA Container
Launch the container with required ports and system settings:
docker run -d \
--name hxe \
-p 39013:39013 -p 39041:39041 \
--ulimit nofile=1048576:1048576 \
--sysctl kernel.shmmax=1073741824 \
--sysctl net.ipv4.ip_local_port_range='60000 65535' \
--sysctl kernel.shmmni=524288 \
--sysctl kernel.shmall=8388608 \
-v /data/hana:/hana/mounts \
--hostname hxehost \
saplabs/hanaexpress \
--agree-to-sap-license \
--passwords-url file:///hana/mounts/hxe-pass.json
Be prepared—startup can take several minutes. Look for a "Startup finished" message in the logs.
5. Verify the Container
Check logs to confirm successful startup:
docker logs -f hxe
Once ready, enter the container’s shell:
docker exec -it hxe bash
whoami # should be hxeadm
HDB info # lists running HANA services
Connect with HANA's SQL shell:
hdbsql -i 90 -d SYSTEMDB -u SYSTEM -p YourStrongPass1
Or connect via JDBC:
jdbc:sap://localhost:39013/?databaseName=SYSTEM
For tenant database:
jdbc:sap://localhost:39041/?databaseName=HXE
Both work as expected.
6. Optional: XSA Version
If you need XS Advanced, use the
saplabs/hanaexpressxsa
image. It follows the same process—just with more ports for XSA. Once started, you can run
xs apps
inside the container to check XSA status.
7. Cleanup and Reuse
Stop and remove the container:
docker stop hxe && docker rm hxe
Mounted volumes persist your database in
/data/hana
, so data is safe for future containers.
Why Docker Helps
- No messy installs: Everything runs inside a container.
- Reproducible: Container config, volume mounts, and JSON files make environments portable.
- Secure: Use JSON files and permissions to manage sensitive credentials.
- Full-featured: Provides in-memory API, SQL console, XSA layer if needed.
Summary
- Tune Linux sysctl settings for HANA.
- Pull
saplabs/hanaexpress
(or XSA version).
- Create a secure password JSON file and set ownership.
- Run the container with correct ulimits, sysctls, ports, and volume mounts.
- Check logs and enter the container to verify services.
- Connect via HDBSQL or JDBC—system or tenant DB.
- Stop/remove when done; data remains in your volume.
With Docker, getting SAP HANA Express Edition running is straightforward—perfect for local dev, testing, or demos. No installations, no complex setup, just command-line confidence. Happy exploring!
image quote pre code