RESTHeart is available as native executables for multiple platforms. These binaries offer faster startup and lower memory usage compared to the Java version.
Native executables are available in the project releases:
restheart-darwin-amd64
- For Intel-based Macsrestheart-darwin-arm64
- For Apple Silicon Macs (M1/M2/M3)restheart-linux-amd64
- For 64-bit Linux systemsrestheart-windows-amd64.exe
- For 64-bit Windows systems
-
Download the appropriate file for your system:
- Intel Mac:
restheart-darwin-amd64
- Apple Silicon Mac:
restheart-darwin-arm64
- Intel Mac:
-
Open Terminal and navigate to the download location:
cd /path/to/download/folder
-
Make the file executable:
chmod +x restheart-darwin-amd64 # or restheart-darwin-arm64
-
Run the executable:
./restheart-darwin-amd64 # or ./restheart-darwin-arm64
-
Option 1: Right-click (or Control+click) on the file in Finder and select "Open". When prompted, click "Open" again.
-
Option 2: Remove the quarantine attribute using Terminal:
xattr -d com.apple.quarantine restheart-darwin-amd64 # or restheart-darwin-arm64
This will allow you to run the application without security warnings.
-
Download the Linux executable:
wget https://github.com/SoftInstigate/restheart/releases/download/latest/restheart-linux-amd64
-
Make it executable:
chmod +x restheart-linux-amd64
-
Run the executable:
./restheart-linux-amd64
-
Download the Windows executable (
restheart-windows-amd64.exe
). -
Open Command Prompt or PowerShell and navigate to the download location:
cd C:\path\to\download\folder
-
Run the executable:
restheart-windows-amd64.exe
The native executables use the same configuration approach as the Java version.
The native executables support the same command-line options as the Java version:
# Start with a specific config file
./restheart-[platform] /path/to/config.yml
# Override configuration properties
./restheart-[platform] --mongo-uri=mongodb://localhost
# Get help
./restheart-[platform] --help
-
Create a systemd service file:
sudo nano /etc/systemd/system/restheart.service
-
Add the following content (adjust paths as needed):
[Unit] Description=RESTHeart MongoDB REST API After=network.target [Service] Type=simple User=restheart ExecStart=/opt/restheart/restheart-linux-amd64 /opt/restheart/etc/restheart.yml Restart=on-failure [Install] WantedBy=multi-user.target
-
Enable and start the service:
sudo systemctl enable restheart sudo systemctl start restheart
-
Create a launch daemon plist file:
sudo nano /Library/LaunchDaemons/com.softinstigate.restheart.plist
-
Add the following content (adjust paths as needed):
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.softinstigate.restheart</string> <key>ProgramArguments</key> <array> <string>/opt/restheart/restheart-darwin-amd64</string> <string>/opt/restheart/etc/restheart.yml</string> </array> <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/> </dict> </plist>
-
Load the service:
sudo launchctl load /Library/LaunchDaemons/com.softinstigate.restheart.plist
-
Open Command Prompt as Administrator and run:
nssm install RESTHeart
-
In the GUI that appears:
- Set the "Path" to the location of your executable
- Set "Startup directory" to the folder containing the executable
- Add any arguments (e.g., path to config file)
- Configure other options as needed
- Click "Install service"
-
Start the service:
net start RESTHeart