Preparation#
- Fly.io account
- Pre-install flyctl (official guide)
- Log in to flyctl (
flyctl auth login
, official guide)
Create a project#
Create a new empty folder locally, navigate to the folder using the command line, and then enter the following command to create the project:
flyctl launch
During the process, you need to set the project name (or leave it blank to generate a name automatically) and select a region (do not select Hong Kong). After confirmation, the system will generate the fly.toml
file.
Create storage#
To ensure data persistence, create a new Volume to store the relevant data. Execute the following command to create:
flyctl volumes create opencat_data --size 1
During the execution, select the same region as in the previous step. This command will create a storage bucket named opencat_data
with a size of 1GB to store subsequent data.
Edit the fly.toml
file#
Insert the following content before the [env]
section:
[build]
image = "bayedev/opencatd:latest"
[mounts]
destination = "/opt/db"
source = "opencat_data"
Modify the internal_port
value under [[services]]
to 80.
Start the server#
Execute flyctl deploy
to start the server and ensure it passes the security check.
Bind a custom domain#
Skip this step if you don't have a custom domain.
Execute flyctl certs add YOUR_DOMAIN
to configure a custom domain (replace YOUR_DOMAIN
with your domain) and configure the corresponding CNAME record as required.
After the configuration is complete, wait for a moment. Visit https://fly.io/apps/APPNAME/certificates
(replace APPNAME with the name you specified when creating the project) to ensure that all check items are successful.
Activation#
Open the OpenCat team creation page and set the domain to https://YOUR_DOMAIN
(replace YOUR_DOMAIN
with the custom domain you bound in the previous step; if not bound, use https://APPNAME.fly.dev
). Confirm the activation to start using it normally.