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 on Amazon EC2

We provide public AMIs for Amazon EC2, based on Ubuntu 16.04. For details on the difference between Paravirtual and HVM see this guide.

  Paravirtual HVM
ap-northeast-1 (Tokyo) ami-d6f5e0b1 ami-edc8dd8a
eu-west-1 (Ireland) ami-59372f3f ami-1f283079
us-east-1 (N. Virginia) ami-a2052bb4 ami-f5022ce3

You can launch these AMIs just as any other Amazon EC2 AMI. Make sure you open port 22/TCP (ssh) and 9080/TCP (dashboard and client access). The default SSH user is ubuntu.

Once you have Realm Object Server installed, go on to Building RealmTasks.

Deploying on Digital Ocean

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.

Digital Ocean select your image distribution section

Select what size makes sense for your project. Even the cheapest droplet can support many concurrent users, and is great for development and testing.

Digital Ocean choose a droplet size section

Choose the datacenter region closest to you.

Digital Ocean choose a datacenter section

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.

Digital Ocean add your SSH keys section

Give your droplet a descriptive hostname, or just click “Create.”

Digital Ocean finalize and create section

Wait until your droplet finishes building, then you’ll see it listed and ready to use:

Digital Ocean droplets screen

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.

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.

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 | 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!

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.

Once you have Realm Object Server installed, go on to Building RealmTasks.

Deploying on Microsoft Azure

The Realm Mobile Platform, Developer Edition, is available on Microsoft’s Azure Marketplace. Other editions of the Realm Mobile Platform will be available at a later date.

Sign into your Azure account, create a new one, or use an existing Microsoft account. This will bring you to your Azure dashboard.

Click the green “➕” to create a new virtual machine, then search for “Realm.” You’ll find “Realm Mobile Platform Developer Edition.” Select it, then click Create. (Unless you’re integrating this with an existing virtual network, you can leave deployment model set on Resource Manager.) Microsoft Azure may prompt you to add a subscription at this point if you don’t have one; you can use the free trial. (Once you’re signed up, you may need to re-add Realm from the Marketplace to go onto the next step.)

Azure New VM Dashboard

Azure will take you through five steps for deploying Realm.

  1. Basics: Fill in the fields here to give your VM a name and an admin user. (You may use a public SSH key here.) Create a new resource group (eg., “realm”) and choose a hosting location near you.
  2. Size: Select the resources (disk size, CPU and speed) for your VM. All of the sizes will work with Realm, although the smallest size is only suitable for testing and very light loads.
  3. Settings: You should be able to accept all the defaults here.
  4. Summary: If it looks good, click OK.
  5. Buy: This will show the price Microsoft will charge for your VM, and a zero-cost “purchase price” for the Realm Mobile Platform. Click Purchase.

You’ll be returned to the Dashboard and given status updates while Azure deploys the Realm Mobile Platform, which may take several minutes.

Once RMP is running, you will be able to access the Realm Object Server’s dashboard at port 9080 using the “Public IP address” shown in the Azure dashboard. (Note we’re talking about two separate dashboards, Azure’s and the Object Server’s!) Open up your web browser and type in http://<azure-public-ip-address>:9080. You should see the Realm Object Server setup page.

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.

Once you have Realm Object Server installed, continue with Building RealmTasks.

Building RealmTasks

The macOS version of RealmTasks

RealmTasks is a simple task management app powered by the Realm Mobile Platform, inspired by Clear by Realmac Software. It’s available for iOS, macOS, and Android, with source code in Swift, Java, JavaScript (React Native), and cross-platform C# (Xamarin).

Get the source code from GitHub. If you’re building for iOS or Android, you can follow one of our tutorials:

Tutorials for React Native and Xamarin are coming soon; in the meantime, you can download and build the app on your own.

If you have a Mac, you can get a local installation of the Realm Object Server and RealmTasks for macOS precompiled with the macOS bundle.

What’s next?

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. Or, you can follow a tutorial to build an iOS app similar to RealmTasks from scratch.

If you’re more familiar with the Realm Mobile Platform (or you came here from the Realm Object Server installation page), then jump right into the Realm Object Server documentation documentation.