Self-host to restart retool automatically on server restart

Hi.

I am new to retool and have successfully setup the on-prem on AWS EC2. I follow the instruction to start the server successfully. sudo docker-compose up -d

However, what should I do if I want to auto-restart the on-prem instance upon server starts? I reboot the virtual machine when I ssh in again, it seems some services are up but services such as postgresql is not.

Thanks for your help.

Hello @Henry_Leung!

1. Update docker-compose.yml with Restart Policies

Add the restart: always policy to each service in your docker-compose.yml file. This ensures Docker automatically restarts the containers when the host machine reboots.

For example:

services:
  postgres:
    image: postgres:13
    restart: always
    ...
  api:
    image: retool-onprem:latest
    restart: always
    ...
  frontend:
    image: retool-frontend:latest
    restart: always
    ...

2. Reapply the Updated Configuration

After editing the docker-compose.yml file, reapply the changes by running:

sudo docker-compose up -d

3. Enable Docker to Start on Boot

Ensure the Docker service itself starts on boot. Use the following command to enable Docker:

sudo systemctl enable docker

4. Verify Setup

  • Check Docker Service: Reboot your virtual machine and confirm the Docker service is running:
systemctl status docker
  • Check Retool Containers: After reboot, confirm your Retool services are running:
sudo docker ps

Let me know if this works for you!

Thanks. Let me try.

1 Like