Skip to content

Self-hosting Altair GraphQL Cloud

Altair GraphQL Cloud is a free and open-source software that you can host on your own server. This allows you to have full control over your data and privacy. You can also customize the software to fit your needs.

DISCLAIMER

Self-hosting Altair GraphQL Cloud requires technical knowledge and experience in server administration. As a small team, we are unable to provide extensive support or guarantees for self-hosting. However, we are happy to help with any questions you may have. For most users, we recommend using the Altair GraphQL Cloud service instead.

Docker

Prerequisites

Before you start self-hosting Altair GraphQL Cloud, you need to have the following:

  • A server with at least 2GB of RAM and 2 CPU cores
  • A domain name (optional, but recommended)
  • A valid SSL certificate for your domain (required for security)
  • Docker and Docker Compose installed on your server
  • Basic knowledge of server administration

Installation

There are two ways to install Altair GraphQL Cloud on your server using Docker:

  1. Using the pre-built Docker image from Docker Hub
  2. Building the Docker image from the source code

Using the pre-built Docker image

To install Altair GraphQL Cloud on your server using the pre-built Docker image, follow these steps:

  1. Create a new directory on your server and navigate to it:

    bash
    mkdir altair-graphql-cloud
    cd altair-graphql-cloud
  2. Create a new file named docker-compose.yml with the following content:

    yaml
    version: '3.8'
    
    services:
      altair-graphql-cloud:
        image: imolorhe/altairgraphqlapi
        ports:
          - '3000:3000'
        environment:
          - JWT_ACCESS_SECRET=your_access_secret
          - EVENTS_JWT_ACCESS_SECRET=your_events_access_secret
          - JWT_REFRESH_SECRET=your_refresh_secret
          - GOOGLE_OAUTH_CLIENT_ID=your_google_oauth_client_id
          - GOOGLE_OAUTH_CLIENT_SECRET=your_google_oauth_client_secret
          - POSTGRES_DB=altair
          - POSTGRES_USER=altair
          - POSTGRES_PASSWORD=altair
          - DATABASE_URL=postgres://altair:altair@postgres:5432/altair
          - STRIPE_SECRET_KEY=your_stripe_secret_key
          - STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
        depends_on:
          - postgres
        restart: always
    
      postgres:
        image: postgres:13
        environment:
          - POSTGRES_DB=altair
          - POSTGRES_USER=altair
          - POSTGRES_PASSWORD=altair
        volumes:
          - ./postgres-data:/var/lib/postgresql/data
        restart: always
  3. Replace the placeholders (your_access_secret, your_events_access_secret, your_refresh_secret, your_google_oauth_client_id, your_google_oauth_client_secret, your_stripe_secret_key and your_stripe_webhook_secret) with your own values. You can generate these secrets using a tool like 1Password.

  4. Run the following command to start Altair GraphQL Cloud:

    bash
    docker-compose up -d
  5. Access Altair GraphQL Cloud in your web browser by visiting http://your-server-ip:3000.

Building the Docker image from the source code

To build the Docker image from the source code, follow these steps:

  1. Clone the Altair GraphQL repository if you haven't already:

    bash
    git clone https://github.com/altair-graphql/altair.git
    cd altair
  2. Build the Docker image using the provided Dockerfile:

    bash
    docker build -t altair-graphql/altair .
  3. Run the container with the necessary environment variables. Refer to the .env.example file for a list of required environment variables:

    bash
    docker run -d -p 3000:3000 \
    -e ENV_VAR1=value1 \
    -e ENV_VAR2=value2 \
    altair-graphql/altair
  4. Access Altair GraphQL Cloud in your web browser

Digitalocean

Deploy to DO

Vercel

Deploy with Vercel

Render

Deploy to Render