Deploying the Realm Object Server
The Realm Object Server is easy to get started on any cloud service provider. In just a few minutes, you’ll be on your way to building powerful new apps with real-time functionality..
Deploying Realm Object Server on Digital Ocean
Set up a Digital Ocean droplet
If you’re just getting started, Digital Ocean is probably the fastest way to get the Realm Object Server up and running on to your own production server. Assuming you’ve already visited Digital Ocean and created an account, here is what you’ll need to do.
Create a droplet by clicking
Create droplet in the upper right corner.
Select Ubuntu as your image distribution.
Select what size makes sense for your project. Even the cheapest droplet can support many concurrent users, and is great for development and testing.
Choose the datacenter region closest to you.
Add your SSH keys. If you don’t already have them on Digital Ocean, you’ll need to set them up, and can follow their guide here.
Give your droplet a descriptive hostname, or just click “Create.”
Wait until your droplet finishes building, then you’ll see it listed and ready to use:
Copy the IP Address, and save it somewhere. You’ll need it to integrate your app with the Realm Object Server, and we’ll be using it to communicate with the server over SSH.
Install the Realm Object Server
Access the server via SSH. Open up your terminal on your machine, and type in
ssh root@<droplet-ip-address-here>. Respond
yes to the prompts, and then you’ll be logged into your new droplet.
Install the Realm Object Server. Now that we’re logged into the droplet as
root, we can follow the Ubuntu install commands for the Realm Object Server.
# Download the Realm Object Server repository from PackageCloud curl -s https://packagecloud.io/install/repositories/realm/realm/script.deb.sh | sudo bash # Update repositories sudo apt-get update # Install the Realm Object Server sudo apt-get install realm-object-server-developer # Enable and start the service sudo systemctl enable realm-object-server sudo systemctl start realm-object-server
Verify the installation. Open up your web browser and type in
http://<droplet-ip-address-here>:9080. You should see this Realm Object Server setup page!
Setup your admin account. Now you’re ready to use the Realm Object Server in your mobile app, simply by referring to the URL you entered into your web browser.
Integrate Realm with your app
Now that your server is up and running, you can sync your app’s data seamlessly between clients. From here, you can follow a tutorial to build a sample app, or jump right into the Realm Object Server documentation to integrate an app that already uses the Realm Mobile Database.
If you’ve never used the Realm Mobile Database before, you might want to start by picking your platform and checking the docs. There, you’ll learn about what makes our database unique, like the power of live objects, auto-updating queries, and the freedom from ever having to use an ORM again.