Docs Menu
Docs Home
/ /
Atlas App Services

Connect to an Edge Server

On this page

  • Connect to the Edge Server from Atlas Device SDK
  • Supported Authentication Providers
  • Roaming Between Edge Servers
  • Example: SwiftUI Template App
  • Connect to the Edge Server with MongoDB Drivers and Tools
  • Anonymous Connections
  • Supported MongoDB APIs
  • Connect with MongoDB Compass

Once the Edge Server instance is configured and running, you can connect to it from a client application.

There are three ways you can connect to the Edge Server instance from a client:

  • Atlas Device SDK: Device Sync automatically synchronizes data across devices and with the Edge Server.

  • MongoDB Drivers and tools: Perform CRUD operations with a subset of supported MongoDB APIs.

  • MongoDB Compass: Explore documents syncing to an Edge Server instance, and make updates to those documents.

To connect to the Edge Server instance from an Atlas Device SDK client, your app must:

  • Set the Sync URL on the App configuration to the public-accessible DNS address you set in the Edge Server edge_config.json baseURL field.

  • If TLS is not enabled, use HTTP over port 80.


While your Edge Server deployment is in development, we recommend connecting with HTTP over port 80 for simplicity. Before moving to production, you can coordinate with your Product or Account Representative to configure HTTPS with a self-signed certificate.

For information about customizing the App configuration, refer to the documentation for your preferred SDK:

Edge Server currently supports the following subset of authentication providers when connecting with an SDK:

SDK clients can roam between Edge Server instances, or between an Edge Server instance and Atlas.

Roaming requires changing the base URL in the client's App configuration. For details, refer to the SDK documentation linked above.

When an SDK user roams, the client app must perform a client reset upon connecting to the new server. For more information about client resets, refer to Client Resets.

When roaming between Edge Server instances or an Edge Server instance and Atlas, anonymous users do not persist across servers. Atlas creates a new anonymous user for each server the client connects to, and does not persist local data across servers.

For all other supported authentication providers, users persist and have access to the expected data across servers.

For a quick proof of concept using a template app, these are the modifications you can make to the Swift template app to connect to the Edge Server instance:


In the Swift template app's atlasConfig, set the values to:

The public-accessible DNS of your Edge Server instance host. This is http://, or if TLS is enabled, https://, followed by the IP address exposed in your Edge Server container configuration.
The App ID of your App Services App that has Edge Server enabled. For more information about finding the App ID, refer to Find Your App ID.

If your app uses TLS, you can disregard this step. If you are developing an Edge Server app with TLS not enabled during development, you must complete this step.

For iOS, Apple disables insecure connections by default. You must add an exception for your public-accessible DNS to allow the client app to connect to it.

Select your App target, and go to the Signing & Capabilities tab. Press the + Capability button, and search for App Transport Security Settings. Add this to your app.

Add an exception domain for your public-accessible DNS. This should be just the string domain, similar to:

This creates an Info.plist file in your project. Go to this file to make the following adjustments.

Change this String key to a Dictionary. Add two more keys for:


This enables your iOS client to connect to the insecure HTTP DNS.

Your Info.plist file should look similar to:

Screenshot of an Info.plist file showing the settings above

You can adjust the log level if you'd like to get additional details about the status of communication with the Edge Server.

In the App file, you can add an .onAppear block to set the log level. Add a log level line in this block to get additional information:

var body: some Scene {
WindowGroup {
ContentView(app: app)
.alert(Text("Error"), isPresented: .constant(errorHandler.error != nil)) {
Button("OK", role: .cancel) { errorHandler.error = nil }
} message: {
Text(errorHandler.error?.localizedDescription ?? "")
.onAppear {
Logger.shared.level = .trace

For more information about setting the log level, refer to Logging - Swift SDK.


Now you can build and run the app. When you log in, the app connects to the Edge Server instance. When you create new Items, those sync with the instance. The instance then syncs with the Atlas App Services App.

You can check the status of the Edge Server instance from your host. With the client running, you can see "num_local_clients": 1 in the instance status. You can also see error messages reflected in the sync status.

After the next time the Edge Server instance syncs with your App Services App, you can see synced changes reflected in the linked Atlas collection.


If you have previously connected directly from the client to your App Services App with Device Sync, you may need to clear state on the simulator or device. Resetting your cache enables your client to connect to the Edge Server instance.

In a console app, delete the mongodb-realm directory. If you're using an iOS or Android simulator or device, uninstall and reinstall the app.

You can connect to the Edge Server using standard MongoDB Drivers and tools. Clients use a specialized MongoDB URI connection string to connect to Edge Server and send requests.

The Wire Protocol server accepts these incoming connections. You can connect to the host machine with a MongoDB URI.

This URI may vary depending on the authentication type. Broadly, it resembles this form:

The username of the Atlas user. For an email/password user, this might look similar to If this username contains an @ symbol, you must escape the @ symbol. For example, becomes
The password of the Atlas user. This might look similar to myPassword123456.
The public DNS of your Edge Server host. While in local development, this might be localhost. Otherwise, it might look similar to For more information, refer to Install and Configure the Edge Server Instance.
The Edge Server Wire Protocol listen port. The default port is 27021. For more details, refer to Install and Configure the Edge Server Instance.
The auth mechanism. Currently, the only supported value is PLAIN.


A Wire Protocol connection URI for an Edge Server instance hosted on Amazon EC2 might look similar to:


You can enable anonymous connections and connect without specifying a username or password. This option is disabled by default.


Disable Anonymous Connections in Production

Enabling anonymous connections can streamline development by bypassing authentication flows. This is only intended as a development aid; do not bypass authentication flows in production environments.


To enable anonymous connections, start the Edge Server with the --insecure-disable-auth flag set to true. This allows you to connect without specifying a username and password.

This setting is false by default. Setting this to true enables connections to bypass authentication.

For more information about using edgectl to configure and start the Edge Server instance, refer to Install and Configure the Edge Server Instance.


When connecting without authentication, the MongoDB URI omits the authentication-related parameters. This simplfied URI is:



An anonymous Wire Protocol connection URI for an Edge Server instance hosted on Amazon EC2 might look similar to:


An anonymous connection to an Edge Server instance running on your machine during development may resemble:


Edge Server currently supports a subset of the MongoDB APIs. For information about the supported APIs, refer to Edge Server MongoDB API Support.

You can connect to the Edge Server instance using the MongoDB URI through MongoDB Compass. Compass enables you to explore the documents syncing to Edge Server instance, and make updates to those documents.

Edge Server support for Compass is limited. You can use it to:

  • Browse databases, collections, and documents in the Edge Server instance.

  • Perform basic CRUD operations on documents in the Edge Server instance.

Edge Server does not support aggregation with Compass at this time.

← Configure Edge Server