{"id":20697952,"url":"https://github.com/fly-apps/postgres-standalone","last_synced_at":"2025-04-22T21:26:25.875Z","repository":{"id":45161776,"uuid":"430763666","full_name":"fly-apps/postgres-standalone","owner":"fly-apps","description":"Standalone Postgres on Fly","archived":false,"fork":false,"pushed_at":"2022-01-20T18:25:05.000Z","size":67,"stargazers_count":2,"open_issues_count":4,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-29T19:01:22.110Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fly-apps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-22T15:32:22.000Z","updated_at":"2023-02-01T12:40:25.000Z","dependencies_parsed_at":"2022-09-09T23:22:56.553Z","dependency_job_id":null,"html_url":"https://github.com/fly-apps/postgres-standalone","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fly-apps%2Fpostgres-standalone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fly-apps%2Fpostgres-standalone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fly-apps%2Fpostgres-standalone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fly-apps%2Fpostgres-standalone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fly-apps","download_url":"https://codeload.github.com/fly-apps/postgres-standalone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250326857,"owners_count":21412330,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T00:20:53.452Z","updated_at":"2025-04-22T21:26:25.860Z","avatar_url":"https://github.com/fly-apps.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Standalone Postgres on Fly.io\n\nThis repo contains all the code and configuration necessary to run a [standalone Postgres instance](https://fly.io/docs/reference/postgres/) on Fly.io. This source is packaged into [Docker images](https://hub.docker.com/r/flyio/postgres-ha/tags) which allow you to track and upgrade versions cleanly as new features are added.\n\nIf you just want to get a standard Postgres standalone or highly-available setup on Fly, [check out the docs](https://fly.io/docs/reference/postgres/).\n## Customizing Postgres behavior\n\nFly Postgres clusters are just regular Fly applications. If you need to customize Postgres in any way, you may fork this repo and deploy using normal Fly deployment procedures. You won't be able to use `fly postgres` commands with custom clusters. But it's a great way to experiment and potentially contribute back useful features!\n\nFollow the rest of this README to run a customized setup.\n\n## Prepare a new application\n\nYou'll need a fresh Fly application in your preferred region to get started. Run these commands within the fork of this repository.\n### `fly launch --no-deploy`\nThis gets you started with a Fly application and an associated config file.\nChoose `yes` when asked whether to copy the existing configuration to the newly generated app.\n\n### Set secrets\nThis app requires a few secret environment variables. Generate a secure string for each, and save them.\n\n`SU_PASSWORD` is the PostgreSQL super user password. The username is `flypgadmin`. Use these credentials to run high privilege administration tasks.\n\n`OPERATOR_PASSWORD` is the password for the standard user `postgres`. Use these credentials for connecting from your application.\n\n`fly secrets set SU_PASSWORD=\u003cPASSWORD\u003e OPERATOR_PASSWORD=\u003cPASSWORD\u003e`\n\n### Create a volume\n\nCreate this volume in the region you specified in the previous step.\n\n```\nfly volumes create pg_data --region ord --size 10 # size in GB\n```\n### Deploy the app\n```\nfly deploy\nfly status\n```\n\n## Connecting\n\nFly apps within the same organization can connect to your Postgres using the following URI:\n\n```\npostgres://postgres:\u003coperator_password\u003e@\u003cpostgres-app-name\u003e.internal:5432/\u003cdatabase-name\u003e\n```\n\n### Connecting to Postgres from your local machine\n\n1. Setup WireGuard Tunnel ( If you haven’t already )\nFollow the steps provided here: https://fly.io/docs/reference/private-networking/#step-by-step\n\n2. Postgres needs to be installed on your local machine.\n\n3. Use psql to connect to your Postgres instance.\n```\npsql postgres://postgres:\u003coperator_password\u003e@\u003cpostgres-app-name\u003e.internal:5432\n```\n\n\n## Having trouble?\n\nCreate an issue or ask a question here: https://community.fly.io/\n\n\n## Contributing\nIf you're looking to get involved, fork the project and send pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffly-apps%2Fpostgres-standalone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffly-apps%2Fpostgres-standalone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffly-apps%2Fpostgres-standalone/lists"}