RESTHeart is a modern backend for Web and Mobile apps, designed to radically simplify server-side development and deployment.
To run RESTHeart you need:
- Java 11 (alternatively, you can just run it with Docker).
- MongoDB (or any API-compatible database).
RESTHeart can work with any database compatible with the MongoDB API. It has been tested with MongoDB Community and Enterprise (v2, v3 and v4), Percona Server for MongoDB, Microsoft Azure Cosmos DB and Amazon DocumentDB.
- To install Java for your operating system download it from AdoptOpenJDK.
- Are you a Java developer and need to manage multiple JDK? We suggest to have a look at SDKMAN!
- Do you have Docker? You can run RESTHeart in a Docker container, even without Java!
Download and Install RESTHeart
Then un-zip it
$ unzip restheart.zip
or un-tar it
$ tar -xzf restheart.tar.gz
The archive will uncompress in the
$ cd restheart
Configuration files are in the
etc/ folder, while extensions are in the
plugins/ folder. You’ll see the main
restheart.jar file in the root.
See the whole directory tree:
. ├── etc/ │ ├── acl.yml │ ├── default.properties │ ├── restheart.yml │ └── users.yml ├── plugins/ │ ├── restheart-mongodb.jar │ └── restheart-security.jar └── restheart.jar
By default, RESTHeart is configured to look for a running MongoDB instance on
- RESTHeart needs at least the Java 11 Runtime Environment. It won’t even start with older versions of Java.
restheart/ folder, execute the following command:
$ java -jar restheart.jar etc/restheart.yml -e etc/default.properties
Check it works
To check that RESTHeart is up and running, open the URL http://localhost:8080/ping. You will see the message:
Greetings from RESTHeart!
Run with Docker
If you prefer to run with containers, RESTHeart is also distributed as a public Docker image. In this case you don’t need to install Java, it is already packaged in the Docker image.
docker-compose you can run both RESTHeart and a dedicated MongoDB instance with a single command!
# 1 - create a new directory $ mkdir restheart && cd restheart # 2 - download the restheart docker-compose file $ curl https://raw.githubusercontent.com/SoftInstigate/restheart/master/docker-compose.yml --output docker-compose.yml # 3 - run the stack $ docker-compose up -d Creating network "temp_restheart-backend" with the default driver Creating volume "temp_restheart-mongo-volume" with default driver Creating restheart-mongo ... done Creating restheart ... done
Again, to check that RESTHeart is up and running, just open the URL http://localhost:8080/ping.
As soon as RESTHeart is up and running, you can jump to the tutorial.
The full source code is available on GitHub.
RESTHeart is distributed under the terms of the OSI-approved AGPL v3 license. A commercial license is available upon request.