Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Add self-hosting docs for Fly.io

Tuan Dang4d0bff4377d3
diff --git a/docs/images/self-hosting/deployment-options/deployment-flyio-secrets.png b/docs/images/self-hosting/deployment-options/deployment-flyio-secrets.png
new file mode 100644
index 0000000000..885e9ec411
Binary files /dev/null and b/docs/images/self-hosting/deployment-options/deployment-flyio-secrets.png differ
diff --git a/docs/mint.json b/docs/mint.json
index 2cfacf1bde..ecb2bb2581 100644
--- a/docs/mint.json
+++ b/docs/mint.json
@@ -162,7 +162,8 @@
"self-hosting/deployment-options/kubernetes-helm",
"self-hosting/deployment-options/aws-ec2",
"self-hosting/deployment-options/docker-compose",
- "self-hosting/deployment-options/digital-ocean-marketplace"
+ "self-hosting/deployment-options/digital-ocean-marketplace",
+ "self-hosting/deployment-options/fly.io"
]
},
"self-hosting/configuration/envars",
diff --git a/docs/self-hosting/configuration/envars.mdx b/docs/self-hosting/configuration/envars.mdx
index 7c108e66b4..3ea1762e2a 100644
--- a/docs/self-hosting/configuration/envars.mdx
+++ b/docs/self-hosting/configuration/envars.mdx
@@ -18,15 +18,14 @@ Other environment variables are listed below to increase the functionality of yo
Must be a random 32 byte base64 string. Can be generated with `openssl rand -base64 32`
</ParamField>
-<ParamField query="MONGO_URL" type="string" default="none" required>
- *TLS based connection string is not yet supported
-</ParamField>
-
-<ParamField query="REDIS_URL" type="string" default="none" required>
- Redis connection string
-</ParamField>
+ <ParamField query="MONGO_URL" type="string" default="none" required>
+ Mongo connection string. *TLS based connection string is not yet supported
+ </ParamField>
-</Tab>
+ <ParamField query="REDIS_URL" type="string" default="none" required>
+ Redis connection string
+ </ParamField>
+ </Tab>
<Tab title="Email service">
<Info>When email service is not configured, Infisical will have limited functionality</Info>
diff --git a/docs/self-hosting/deployment-options/fly.io.mdx b/docs/self-hosting/deployment-options/fly.io.mdx
index b8c561224f..35e962130b 100644
--- a/docs/self-hosting/deployment-options/fly.io.mdx
+++ b/docs/self-hosting/deployment-options/fly.io.mdx
@@ -1,63 +1,108 @@
---
title: "Fly.io"
-description: "Learn to install Infisical on Fly.io"
+description: "Deploy Infisical with Fly.io"
---
-**Prerequisites**
-- Familiar with Fly.io deployment
-- Logged in via fly CLI
-
-#### 1. Make a copy of the deployment config
-To begin, you'll to make a copy of the following file on your local machine
-
-```toml fly.toml
-# fly.toml app configuration file generated for infisical on 2023-05-05T08:57:03-04:00
-#
-# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
-#
-
-app = "infisical"
-primary_region = "iad"
-
-[build]
- image = "infisical/infisical:latest"
-
-[env]
- ENCRYPTION_KEY = <>
- JWT_AUTH_SECRET = <>
- JWT_REFRESH_SECRET = <>
- JWT_SERVICE_SECRET = <>
- JWT_SIGNUP_SECRET = <>
- MONGO_URL = <>
-
-[http_service]
- internal_port = 8080
-
-```
-
-#### 2. Add environment variables
-
-Before we can deploy Infisical, we'll need to provide values for the keys under `[env]` config block. For each of the following keys
-
-- `ENCRYPTION_KEY`
-- `JWT_AUTH_SECRET`
-- `JWT_REFRESH_SECRET`
-- `JWT_SERVICE_SECRET`
-- `JWT_SIGNUP_SECRET`
-
-you will need to generate a random 16 byte hex string. This can can be generated with `openssl rand -hex 16`.
-
-
-Lastly, the `MONGO_URL` environment variable requires a document database connection URL.
-You can obtain this URL by creating a document database using services such as [MongoDB](https://www.mongodb.com/), [AWS DocumentDB](https://aws.amazon.com/documentdb/), and others.
-
-#### 3. Deploy
-
-Run `fly launch` in the directory where you have the local version of config from step 1 and follow the instructions.
-Once done, your very own instance of Infisical should be up and running on Fly.io.
-
-Please note that this version of Infisical requires at least 250MB of memory to operate smoothly.
-
-<Info>
-Once installation is complete, you will have to create the first account. No default account is provided.
-</Info>
+Prerequisites:
+- Have an account with [Fly.io](https://fly.io/)
+- Have installed the [Fly.io CLI](https://fly.io/docs/hands-on/install-flyctl/)
+
+<Steps>
+ <Step title="Create an app with Fly.io">
+ In your terminal, run the following command from the source directory of your project to create a new Fly.io app
+ with a `fly.toml` configuration file:
+
+ ```
+ fly launch
+ ```
+ </Step>
+ <Step title="Edit the fly.toml configuration file">
+ Add a **build** section to the `fly.toml` file to specify the [Infisical public Docker image](https://hub.docker.com/r/infisical/infisical):
+
+ ```
+ [build]
+ image = "infisical/infisical:v0.43.4"
+ ```
+
+ Afterwards, your `fly.toml` file should look similar to:
+
+ ```
+ app = "infisical"
+ primary_region = "lax"
+
+ [http_service]
+ internal_port = 8080
+ force_https = true
+ auto_stop_machines = true
+ auto_start_machines = true
+ min_machines_running = 0
+ processes = ["app"]
+
+ [[vm]]
+ cpu_kind = "shared"
+ cpus = 1
+ memory_mb = 1024
+
+ [build]
+ image = "infisical/infisical:v0.43.4"
+ ```
+
+ <Note>
+ Depending on your use-case and requirements, you may find it helpful to further configure your `fly.toml` file
+ with options [here](https://fly.io/docs/reference/configuration/).
+
+ For example, you may want to adjust the `primary-region` option to specify which [region](https://fly.io/docs/reference/regions/) to create the new machine for your
+ instance of Infisical to minimize distance and therefore latency between the instance and your infrastructure.
+ </Note>
+
+ </Step>
+ <Step title="Set secrets for your Fly.io app">
+ Running Infisical requires a few environment variables to be set on the Fly.io machine.
+ At minimum, Infisical requires that you set the variables `ENCRYPTION_KEY`, `AUTH_SECRET`, `MONGO_URL`, and `REDIS_URL`
+ which you can read more about [here](/self-hosting/configuration/envars).
+
+ For this step, we recommend setting the variables as Fly.io [app secrets](https://fly.io/docs/reference/secrets/) which
+ are made available to the app as environment variables. You can set the variables either via the Fly.io CLI or project [dashboard](https://fly.io/dashboard).
+
+ <Tabs>
+ <Tab title="CLI">
+ Run the following command (with each `VALUE` replaced) in the source directory of your project to set the required variables:
+
+ ```
+ flyctl secrets set ENCRYPTION_KEY=VALUE AUTH_SECRET=VALUE MONGO_URL=VALUE REDIS_URL=VALUE...
+ ```
+ </Tab>
+ <Tab title="Dashboard">
+ In Fly.io, head to your Project > Secrets and add the required variables.
+
+ ![Fly.io deployment secrets](/images/self-hosting/deployment-options/deployment-flyio-secrets.png)
+ </Tab>
+ </Tabs>
+
+ <Note>
+ To use more features like emailing and single sign-on, you can set additional configuration options [here](/self-hosting/configuration/envars).
+ </Note>
+ </Step>
+ <Step title="Deploy the Fly.io app">
+ Finally, run the following command in the source directory of your project to deploy your Infisical instance on Fly.io
+ with the updated `fly.toml` configuration file from step 2 and secrets from step 3:
+
+ ```
+ fly deploy
+ ```
+ </Step>
+</Steps>
+
+<AccordionGroup>
+ <Accordion title="Do you have any recommendations for deploying Infisical with Fly.io?">
+ Yes, here are a few that come to mind:
+ - In step 2, we recommend pinning the Docker image to a specific [version of Infisical](https://hub.docker.com/r/infisical/infisical/tags)
+ instead of referring to the `latest` tag to avoid any unexpected version-to-version migration issues.
+ - In step 2, we recommend selecting a `primary_region` option that is closest to your infrastructure/clients to reduce latency; a full list of regions supported by Fly.io can be found [here](https://fly.io/docs/reference/regions/).
+
+ We're working on putting together a fuller list of deployment best practices as well as minimum resource configuration requirements for running Infisical so stay tuned!
+ </Accordion>
+</AccordionGroup>
+
+Resources:
+- [Fly.io documentation](https://fly.io/docs/)
\ No newline at end of file
diff --git a/docs/self-hosting/deployment-options/gcp-cloud-run.mdx b/docs/self-hosting/deployment-options/gcp-cloud-run.mdx
new file mode 100644
index 0000000000..2a7f833a2d
--- /dev/null
+++ b/docs/self-hosting/deployment-options/gcp-cloud-run.mdx
@@ -0,0 +1,5 @@
+---
+title: "GCP Cloud Run"
+description: "Deploy Infisical with GCP Cloud Run"
+---
+
diff --git a/docs/self-hosting/deployment-options/standalone-infisical.mdx b/docs/self-hosting/deployment-options/standalone-infisical.mdx
index 418459375a..fbfa1b2a16 100644
--- a/docs/self-hosting/deployment-options/standalone-infisical.mdx
+++ b/docs/self-hosting/deployment-options/standalone-infisical.mdx
@@ -24,25 +24,23 @@ docker pull infisical/infisical:latest
## Run with docker
To run Infisical, we'll need to configure the required configs listed below.
Other configs can be found [here](../configuration/envars)
-
+
<ParamField query="ENCRYPTION_KEY" type="string" default="none" required>
Must be a random 16 byte hex string. Can be generated with `openssl rand -hex 16`
</ParamField>
<ParamField query="AUTH_SECRET" type="string" default="none" required>
- Must be a random 16 byte hex string. Can be generated with `openssl rand -hex 16`
+ Must be a random 32 byte base64 string. Can be generated with `openssl rand -base64 32`
</ParamField>
<ParamField query="MONGO_URL" type="string" default="none" required>
- A MongoDB connection string. Can use any MongoDB PaaS such as Mongo Atlas, AWS Document DB, etc.
*TLS based connection string is not yet supported
</ParamField>
-<ParamField query="REDIS_URL" type="string" default="none">
- Redis connection string. Only required if you plan to use web integrations or secret reminders.
+<ParamField query="REDIS_URL" type="string" default="none" required>
+ Redis connection string
</ParamField>
-
Once you have added the required environment variables to your docker run command, execute it in your terminal.
```bash
diff --git a/docs/self-hosting/overview.mdx b/docs/self-hosting/overview.mdx
index 8e72c5c011..975c7ba316 100644
--- a/docs/self-hosting/overview.mdx
+++ b/docs/self-hosting/overview.mdx
@@ -33,10 +33,17 @@ Choose from a variety of deployment options listed below to get started.
Install Infisical using our Docker Compose template
</Card>
<Card
- title="Kubernetes"
- color="#ea5a0c"
- href="deployment-options/kubernetes-helm"
->
+ title="Kubernetes"
+ color="#ea5a0c"
+ href="deployment-options/kubernetes-helm"
+ >
Use our Helm chart to Install Infisical on your Kubernetes cluster
-</Card>
+ </Card>
+ <Card
+ title="Fly.io"
+ color="#ea5a0c"
+ href="deployment-options/fly.io"
+ >
+ Deploy Infisical with Fly.io
+ </Card>
</CardGroup>