Skip to main content
Docker is the easiest way to get started with pgtofu. The official image includes both pgtofu and golang-migrate.

Pull the Image

Verify Installation

Usage with Docker

When using Docker, mount your local directories and pass environment variables:
Create a shell alias to simplify Docker usage:

Network Access

To connect to a local database from Docker, use the host network mode on Linux or host.docker.internal on macOS/Windows:

Install from Source

Prerequisites

  • Go 1.25 or later
  • Git

Using go install

Ensure $GOPATH/bin (or $HOME/go/bin) is in your PATH:

Building from Source

Build with Version Information

Build Docker Image Locally

If you want to customize the Docker image or build from a specific branch:

Multi-Architecture Build

To build for multiple platforms:

Verifying Installation

After installation, verify pgtofu is working:

Installing golang-migrate

pgtofu generates migration files compatible with golang-migrate. Install it to apply migrations:

System Requirements

Next Steps

Quickstart

Follow the quickstart guide to start using pgtofu

CLI Reference

Learn about all available commands and options