Setup with Docker
Run RESTHeart with Docker, MongoDB running on localhost
If MongoDB is not already running, the following command will start a replica set and initiate it (the replica set is not required but enables RESTHeart to support transactions and change streams). Note that the data path is
$ mkdir -p /tmp/db && mongod --fork --syslog --replSet=foo -dbpath=/tmp/db && mongo --eval 'if (!rs.status().ok) rs.initiate();'
Run RESTHeart with:
On OSX and Windows:
$ docker run -it --rm -p "8080:8080" softinstigate/restheart
$ docker run -it --rm -p "8080:8080" --add-host host.docker.internal:host-gateway softinstigate/restheart
This command relies on the docker support of
Run with docker-compose
To run both RESTHeart and MongoDB services you can use
docker compose. Just copy and paste the following shell command:
$ curl https://raw.githubusercontent.com/SoftInstigate/restheart/6.2.x/docker-compose.yml --output docker-compose.yml $ docker compose up
|Watch Docker / Docker Compose video.|
Run both RESTHeart and MongoDB with Docker
1) Create a Docker network:
$ docker network create restheart-network
2) Run a MongoDB container
$ docker run -d --name mongodb --network restheart-network mongo:5.0
3) Run a RESTHeart container
$ docker run -d --rm --network restheart-network -p "8080:8080" -e RH_MONGO_URI="mongodb://mongodb" softinstigate/restheart
$ http -b http://localhost:8080/ping Greetings from RESTHeart!
The "distroless" images are for special deployment requirements, where having the smallest possible image size and the very minimal security attack surface is required and their tag contains a
distroless label. You usually don’t need these images unless you exactly know what you are doing.
Images tags ending with
-native are created with the GraalVM Native Image technology starting from stable builds of the product, especially suited for high demanding environments, like Kubernetes. These are experimental and not fully documented yet, please contact us for questions.
Check that RESTHeart is up and running, opening the URL http://localhost:8080/ping, you should see the message:
Greetings from RESTHeart!
Check the Configuration page
Play with the Tutorial
Deploy some plugins from the the plugin examples repo
Load the sample data into MongoDB and play with the Data API.