Setting up a Timescale DB on Google Compute Engine

  1. sudo sed -i “s/#\(shared_preload_libraries *= *\).*/\1'timescaledb’/” $POSTGRES_CONF
  1. # Add a superuser postgres:
  1. #!/usr/bin/env bash

Finishing it up

Setting a password for the database user

ssh into your newly created VM instance and verify that the script has finished successfully.

Setting up the firewall to allow external connections

First we must configure PostgreSQL for remote access. To do this edit the pg_hba.conf file (under /etc/postgresql/9.6/main in this example). Scroll all the way to the bottom and add the following line:

  • Set the Targets to “All instances in the network”.
  • Set the source IP range to your local IPv4 address with /32 CIDR suffix. This must match the IP specified within pg_hba.conf file above
  • Set the specified protocols and ports to tcp:5432



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
WalkingTree Technologies

WalkingTree Technologies


WalkingTree is an IT software and service provider recognized for its passion for technology.