banner
moeyy

moeyy

一条有远大理想的咸鱼。
github
mastodon
email

Deploying Alist using Fly.io

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.

ProductFree QuotaDescription
VM: shared-cpu2340 hours per monthRun 3 shared CPU VMs with 256 MB of memory 24/7
Volumes3GBProvides 3GB of permanent storage
Bandwidth160GB/monthFree 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

image

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

image

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:

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.