{"id":19383934,"url":"https://github.com/docspring/docspring-enterprise-aptible","last_synced_at":"2026-06-12T06:31:24.725Z","repository":{"id":66068873,"uuid":"423636564","full_name":"DocSpring/docspring-enterprise-aptible","owner":"DocSpring","description":"On-premise setup instructions for Aptible","archived":false,"fork":false,"pushed_at":"2021-11-02T00:25:55.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-29T06:07:46.444Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/DocSpring.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-01T22:38:31.000Z","updated_at":"2023-02-25T12:11:09.000Z","dependencies_parsed_at":"2023-04-13T19:17:02.201Z","dependency_job_id":null,"html_url":"https://github.com/DocSpring/docspring-enterprise-aptible","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DocSpring/docspring-enterprise-aptible","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DocSpring%2Fdocspring-enterprise-aptible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DocSpring%2Fdocspring-enterprise-aptible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DocSpring%2Fdocspring-enterprise-aptible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DocSpring%2Fdocspring-enterprise-aptible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DocSpring","download_url":"https://codeload.github.com/DocSpring/docspring-enterprise-aptible/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DocSpring%2Fdocspring-enterprise-aptible/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34232789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10T09:28:27.113Z","updated_at":"2026-06-12T06:31:24.699Z","avatar_url":"https://github.com/DocSpring.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploy DocSpring On Premise\n\n## Requirements\n\n* An [Aptible](https://www.aptible.com) account\n* DocSpring License Key (must be set in the `DOCSPRING_LICENSE` environment variable.)\n* Credentials for DocSpring’s Docker Registry\n\n\u003e You should have received the DocSpring license key and Docker credentials (AWS Access Token ID and Secret) via Slack or email.\n\n## Run DocSpring on Aptible\n\n1. Go to your Aptible dashboard and make sure you've added a public SSH key to your Aptible account.\n2. Install the [Aptible CLI](https://deploy-docs.aptible.com/docs/cli)\n3. Run `aptible login` to authenticate\n4. Clone this repository. `git clone https://github.com/DocSpring/docspring-enterprise-aptible.git`\n5. Change your working directory `cd docspring-enterprise-aptible`\n6. If desired, update the `Dockerfile` with your desired version (replace `:latest` with a version tag)\n7. Create a new app on Aptible `aptible apps:create docspring-enterprise`\n8. Add a postgres database `aptible db:create docspring-enterprise-postgres --type postgresql --version 11`\n9. Add a redis database `aptible db:create docspring-enterprise-redis --type redis --version 5.0`\n10. Connect to your AWS bucket (see instructions below)\n11. Set your app config variables. Use these instructions to set `REDIS_URL` and `DATABASE_URL`: https://deploy-docs.aptible.com/docs/database-credentials#using-database-credentials\n\n```bash\n$ ADMIN_PASSWORD=\"$(openssl rand -hex 6)\"\n$ echo \"After app is deployed, you can log in with username: admin@example.com, password: $ADMIN_PASSWORD\"\n\n$ aptible config:set --app \"docspring-enterprise\" \\\n    APTIBLE_PRIVATE_REGISTRY_USERNAME=\"\u003cAWS Access Token ID\u003e\" \\\n    APTIBLE_PRIVATE_REGISTRY_PASSWORD=\"\u003cAWS Secret Access Token\u003e\" \\\n    DOCSPRING_LICENSE=\"\u003cdocspring license key\u003e\" \\\n    DATABASE_URL=\"\u003cpg-connection-string\u003e\" \\\n    REDIS_URL=\"\u003credis-connection-string\u003e\" \\\n    DISABLE_EMAILS=\"true\" \\\n    SECRET_KEY_BASE=\"$(openssl rand -hex 64)\" \\\n    SUBMISSION_DATA_ENCRYPTION_KEY=\"$(openssl rand -hex 32)\" \\\n    ADMIN_NAME=\"Admin\" \\\n    ADMIN_EMAIL=\"admin@example.com\" \\\n    ADMIN_PASSWORD=\"$ADMIN_PASSWORD\"\n```\n\n12. Set \"Optional configuration\" variables (see instructions below)\n13. Add aptible as a remote and push\n```\ngit remote add aptible git@beta.aptible.com:\u003captible-environment\u003e/docspring-enterprise.git\ngit push aptible master\n```\n\u003e You can find your environment name by running: `aptible environment:list`\n\u003e If you have any problems pushing to Aptible, take a look at this troubleshooting guide: https://deploy-docs.aptible.com/docs/permission-denied-git-push\n\n14.  Create an Aptible endpoint for `web`. **Make sure to set the container port to 8000**.\n15.  Set your custom host url (e.g., `docspring.company.com`) using the `SETTINGS__HOST_URL` config variable\n16.  We recommend setting the **RAM for each container to ~2GB** and scaling up as needed.\n```\naptible config:set --app \u003capp-slug\u003e \\ \n    SETTINGS__HOST_URL=\u003captible-endpoint-host\u003e\n```\n\n### Troubleshooting\n\n## Docker Image Authentication\n\nIf you are having problems authenticating with AWS ECR to fetch the Docker image, e.g.:\n\n```\nINFO -- : Using private repository credentials from APTIBLE_PRIVATE_REGISTRY_USERNAME and APTIBLE_PRIVATE_REGISTRY_PASSWORD\nINFO -- : Fetching app image: 691950705664.dkr.ecr.us-east-1.amazonaws.com/docspring/enterprise...\nERROR -- : unauthorized: authentication required\n```\n\nTry authenticating on your local machine using the AWS CLI and Docker and ensure this works:\n\n```bash\nexport AWS_ACCESS_KEY_ID=\"\u003cAWS Access Token ID\u003e\"\nexport AWS_SECRET_ACCESS_KEY=\"\u003cAWS Secret Access Token\u003e\"\naws ecr get-login-password | docker login --username AWS --password-stdin \"691950705664.dkr.ecr.us-east-1.amazonaws.com\"\n# =\u003e Login Succeeded\n\ndocker pull \"691950705664.dkr.ecr.us-east-1.amazonaws.com/docspring/enterprise:latest\"\n# =\u003e latest: Pulling from docspring/enterprise\n# =\u003e Digest: sha256:dac6300bf72d964a09a8069c8c9005613cb7434af0d211535158805b5d83bbd1\n# =\u003e ...\n```\n\n\n### Database users\n\nWhen you ran `aptible db:create \u003c...\u003e`, you created a postgres database with 2 users: `postgres` and `aptible`. \nIn order to create the database, perform rollbacks, execute all migrations in future releases, maintain the Superuser role for the user you specified in your `DATABASE_URL` connection string.\n\nYou can verify which users are in your database by creating an ephemeral database tunnel `aptible db:tunnel \u003captible-db-name\u003e`.\n```bash\n$ aptible db:tunnel \u003captible-db-name\u003e --type postgresql\nCreating postgresql tunnel to \u003captible-db-name\u003e...\nUse --type TYPE to specify a tunnel type\nValid types for pg-dev: postgresql\nConnect at postgresql://aptible:\u003cpassword\u003e@localhost.aptible.in:\u003cport\u003e/db\nOr, use the following arguments:\n* Host: localhost.aptible.in\n* Port: \u003cport\u003e\n* Username: aptible\n* Password: \u003cpassword\u003e\n* Database: db\nConnected. Ctrl-C to close connection.\n```\nAnd in a separate terminal\n```postgresql\n$ psql postgresql://aptible:\u003cpassword\u003e@localhost.aptible.in:\u003cport\u003e/db\ndb=# \\du\n                                   List of roles\n Role name |                         Attributes                         | Member of\n-----------+------------------------------------------------------------+-----------\n aptible   | Superuser                                                  | {}\n postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}\n```\n\nYou can create a new role if you so choose\n```postgresql\ndb=# create user mynewrole;\nCREATE ROLE\ndb=# alter user mynewrole with superuser;\nALTER ROLE\ndb=# \\du\n                                   List of roles\n Role name |                         Attributes                         | Member of\n-----------+------------------------------------------------------------+-----------\n aptible   | Superuser                                                  | {}\n mynewrole | Superuser                                                  | {}\n postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}\n```\n\nIf you want to use `mynewrole`, you'll need to change the `DATABASE_URL` connection string.\n\n### Connect to your AWS bucket:\n\nYou will need an S3 bucket, a User, and an IAM policy.\n1. Create a new S3 bucket for DocSpring (e.g., `docspring-data`)\n2. Create a new User for DocSpring (e.g., `docspring`) in your AWS IAM settings. Keep your access key ID and secret access key somewhere safe. Those should be used to set `SETTINGS__AWS__ACCESS_KEY_ID` and `SETTINGS__AWS__SECRET_ACCESS_KEY`, respectively \n3. Attach an S3 bucket policy with the following configuration\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"ListObjectsInBucket\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": [\n                \"arn:aws:s3:::docspring-data\"\n            ]\n        },\n        {\n            \"Sid\": \"AllObjectActions\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"s3:*Object\",\n            \"Resource\": [\n                \"arn:aws:s3:::docspring-data/*\"\n            ]\n        }\n    ]\n}\n```\n4. Edit your bucket permissions by navigating to the bucket \u003e \"Permissions.\n```json\n[\n    {\n        \"AllowedHeaders\": [\n            \"Authorization\"\n        ],\n        \"AllowedMethods\": [\n            \"GET\"\n        ],\n        \"AllowedOrigins\": [\n            \"*\"\n        ],\n        \"ExposeHeaders\": [],\n        \"MaxAgeSeconds\": 3000\n    },\n    {\n        \"AllowedHeaders\": [\n            \"*\"\n        ],\n        \"AllowedMethods\": [\n            \"PUT\",\n            \"POST\"\n        ],\n        \"AllowedOrigins\": [\n            \"*\"\n        ],\n        \"ExposeHeaders\": [],\n        \"MaxAgeSeconds\": 3000\n    }\n]\n```\n\n* Note: You may also set allowed origins to the domain at which you're hosting DocSpring (with no trailing forward slash)\n\n## Optional configuration\n\nSee: [DocSpring Enterprise Configuration (Environment Variables)](https://docs.google.com/document/d/1av1w3JDvvQOxXcywQ-L7HHSVJONxiL94Ih_E2agLzOQ/edit)\n\n## Google OAuth Details (Pending)\n\nTo set up OAuth for your internal team, start by logging into your the the Google Cloud Platform for your team's workspace. Then, do the following:\n\n1. Create a new project\n2. Go to `APIs and Services`\n3. Create an `OAuth consent screen` and make it “internal”\n4. Create a new `Credentials \u003e OAuth client ID \u003e web application`\n5. Add `https://\u003cyourdomain\u003e` (from the endpoint creation step. should be the same as `SETTINGS__HOST_URL`) to \"Authorized Javascript Origins\"\n6. Add `https://\u003cyourdomain\u003e/users/auth/google_oauth2/callback` to \"Authorized redirect URIs\"\n7. Save\n8. Back in your terminal, set:\n\n```bash\naptible config:set --app \u003capp-name\u003e GOOGLE_OAUTH_CLIENT_ID=\u003cnew_client_id\u003e GOOGLE_OAUTH_CLIENT_SECRET=\u003cnew_client_secret\u003e\n```\n\n## Public API Considerations\n\nIf you're running DocSpring on-premise on a private network (or something like Cloudflare zero trust), then you'll need to allow-list public API endpoints\nto confinue using them without the request being blocked.\nOur api routes are `/api/*`. For example, the Generate PDF route is `https://api.docspring.com/api/v1/templates/\u003cTEMPLATE_ID\u003e/submissions` \nTo permit future routes and versions, we suggest allow-listing `\u003cyour-domain\u003e/api/*` routes.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocspring%2Fdocspring-enterprise-aptible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocspring%2Fdocspring-enterprise-aptible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocspring%2Fdocspring-enterprise-aptible/lists"}