Introduction#
Fly.io has a certain amount of free usage quota, and their goal is to allow small applications to run for free, and pay a certain fee when scaling is needed. Fly.io applications are billed separately based on usage.
Fly.io bills per individual user or organization, so if you want more free applications, you can create multiple organizations.
Product | Free Quota | Description |
---|---|---|
VM: shared-cpu | 2340 hours per month | Run 3 shared CPU VMs with 256 MB of memory 24/7 |
Volumes | 3GB | Provides 3GB of permanent storage |
Bandwidth | 160GB/month | Free traffic is 30G for Asia and India, and 100G for the US and Europe |
Preparation#
This deployment uses a data persistence layer to archive Alist's Sqlite3 database. Although Fly.io provides PostgreSQL, it requires an additional VM resource, and once a free user creates a PostgreSQL, it consumes the free 1G space. If you use Sqlite3, it only consumes 1G of permanent space.
Install FlyCTL#
macOS
curl -L https://fly.io/install.sh | sh
Linux
curl -L https://fly.io/install.sh | sh
Windows
powershell -Command "iwr https://fly.io/install.ps1 -useb | iex"
Register and Login#
fly.io requires credit card binding
# Sign up
flyctl auth signup
# Login
flyctl auth login
After logging in, you can start deploying the application.
Create an Application#
git clone https://github.com/moeyy01/alist-fly
cd alist-fly
flyctl launch
Before deploying, create a 1GB permanent storage:
# Create a 1G persistent storage space (minimum unit 1)
flyctl volumes create data --size 1 --app APP_NAME
Replace APP_NAME with the name of the app you just created.
After creating, add the following at the bottom of the fly.toml configuration file:
[mounts]
destination = "/opt/alist/data"
source = "data"
After adding, check if the internal_port in the configuration file is 5244. Once checked, you can deploy by entering flyctl deploy
.
Wait for the deployment to complete. After the deployment is complete, you can go to the official website control panel to view it, or enter flyctl open
to open the website.
Advanced#
If you want to modify the configuration file, enter flyctl ssh console
in the project directory to connect via SSH. After finding the configuration file, enter fly vm restart <instance-id> -a <app-name>
to restart the instance.
instance-id
is the ID of your running application, which can be seen on the control panel, and app-name
is the name of your application.
Official Documentation:
Demo URL: