ankita_sarkar
ServiceNow Employee

Running a MID Server in Docker on an Apple Silicon Mac is a clean, lightweight alternative to a full VM. This walkthrough covers the whole flow: verifying Docker, building the image from the Linux MID Server recipe, and running the container with your instance credentials.

 

Prerequisite:

  1. Docker Desktop is installed and running on your Mac.
  2. A web service user created in serviceNow and assign the role "mid_server" and generate the user's password.

 

Steps to build and run the Docker image:

  1. Open Docker Desktop and confirm it is running.
  2. Open a terminal and run docker ps to check for running containers. If this is your first time, the list will be empty.
  3. From the ServiceNow MID Server download page, download the Linux Docker recipe.[image: Linux_docker_recipe]
  4. Move the downloaded file to a secure location in your local machine. 
  5. Unzip the file in your secure location.
  6. From terminal, use command cd "to-the-directory" where MID server file is stored
    cd to-the-directory
  7. Inside the directory you will find a Dockerfile.
  8. Build the image (note the --platform linux/amd64 flag, which is required on Apple Silicon). Below is the command and "server_image" is the docker image which you will be creating. [image: Dockerimage]
    docker build --platform linux/amd64 -t server_image .
  9. Create a .env file to hold your MID Server environment variables in the same working directory. Below is the format in which you would like to store the variables. Note: Create a machine user in ServiceNow instance and assign role "mid_server" to the user and generate the password.
   MID_INSTANCE_URL=https://<your-instance>.service-now.com/
   MID_SERVER_NAME=<your-desired-midserver-name>
   MID_INSTANCE_USERNAME=<your-mid-user>
   MID_INSTANCE_PASSWORD=<your-mid-password>
  1. Run the container using the .env file in the same working directory:
    docker run -d --name <your-desired-midserver-name> --env-file .env server_image
  2. Navigate to MID Server > Servers. Your ServiceNow MID Server is now up. Confirm it appears.
  3. Click on the MID server and click "validate" under Related Links and it validates your server in this ServiceNow instance.