Docker (Recommended)
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:Network Access
To connect to a local database from Docker, use the host network mode on Linux orhost.docker.internal on macOS/Windows:
- Linux
- macOS / Windows
Install from Source
Prerequisites
- Go 1.25 or later
- Git
Using go install
$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:- macOS
- Linux
- Go Install
- Docker
System Requirements
| Component | Requirement |
|---|---|
| PostgreSQL | 12 or later |
| TimescaleDB | 2.0 or later (optional) |
| Go | 1.25 or later (for building from source) |
| Docker | 20.10 or later (for Docker installation) |