Install Indexing Service on Linux

Let's see how to run the Indexer Service on a cloud provider.

Run Indexer Services on Cloud Linux Instance

We will use a Linux EC2 instance from AWS in the following examples.

Note: You can use any other cloud provider, but we will be able to provide only limited support and troubleshooting help.

Step 1 - Launch a Virtual Machine

Follow these instructions to launch an EC2 instance:

How to Set Up an Indexer with AWS

  • We recommend a t3.medium linux EC2

Step 2 - Install Docker and Docker-Compose

  • SSH access to the EC2 instance:
 ssh -i key_file.pem


DO NOT skip checking the Indexer Version after you finish the SSH process.


Please change the default PostgreSQL password in the POSTGRES_PASSWORD field and in the coordinator-service's postgres-password field. Replace it with your own one.

  • Then, install Docker and set auto start:
sudo yum install docker
sudo systemctl enable docker
sudo systemctl start docker
  • Note that you need to install the docker-compose command tool in EC2, in order to use the docker-compose features:
# get the latest version for docker-compose
sudo curl -L$(uname -s)-$(uname -m) -o /usr/bin/docker-compose

# fix permissions after download:
sudo chmod +x /usr/bin/docker-compose

# verify the installation
sudo docker-compose version

Step 3 - Download the Docker Compose File for Indexer Services

Run the following command:

mkdir subquery-indexer && cd subquery-indexer
curl -o docker-compose.yml


Please change the POSTGRES_PASSWORD in postgres and postgres-password in coordinator-service to your own one

Step 4 - Start Indexer Services

Run the service using the following command:

sudo docker-compose up -d

It will start the following services:

  • coordinator_db
  • coordinator_service
  • coordinator_proxy
  • proxy-redis


Each project you start indexing will create 2 extra containers node_qm---------- and query_qm---------- that has the 13 first characters of the project's Qm-hash.

Now, check the service status:

CLI- Check Service Status

Step 5 - Set Up Auto Start

Create /etc/systemd/system/subquery.service.

Description="Subquery systemd service"

ExecStart=/usr/bin/docker-compose up -d


Register and start the service by running:

systemctl enable subquery.service
systemctl start subquery.service

After that, verify that the service is running:

systemctl status subquery.service

Next Steps

You have successfully installed and started the Indexer Service on Linux. Now, move forward to connect with MetaMask.


Having trouble running a command or setting up the service? Got stuck in the process? Find your solutions here.