Download
[root@liqiang.io]# wget https://github.com/alist-org/alist/releases/download/v3.7.2/alist-linux-amd64.tar.gz
[root@liqiang.io]# tar zxf alist-linux-amd64.tar.gz
[root@liqiang.io]# sudo ./alist admin
INFO[2023-01-03 20:57:22] reading config file: data/config.json
INFO[2023-01-03 20:57:22] load config from env with prefix: ALIST_
INFO[2023-01-03 20:57:22] init logrus...
WARN[2023-01-03 20:57:22] not enable search
INFO[2023-01-03 20:57:22] admin user's info:
username: admin
password: abc1234
Deploy
[root@liqiang.io]# cat /usr/lib/systemd/system/alist.service
[Unit]
Description=alist
After=network.target
[Service]
Type=simple
WorkingDirectory=path_alist
ExecStart=path_alist/alist server
Restart=on-failure
[Install]
WantedBy=multi-user.target
[root@liqiang.io]# sudo systemctl daemon-reload
[root@liqiang.io]# sudo systemctl enable alist
[root@liqiang.io]# sudo systemctl start alist
Config
Storage Config
Open http://localhost:5244 and you will see this page:
Figure 1:alist default mainpage |
---|
Ignore the error above,and click the login button at the bottom:
Figure 2:alist login |
---|
then input the username and password which can be find at the download step, the output for alist admin
command:
Figure 3:alist username password |
---|
and then configure storage:
Figure 4:add Storage |
---|
here I’m trying to add a local storage:
Figure 5:add a local storage |
---|
And then you reopen http://localhost:5244, there will be some content。
Figure 6:mainpage after configure storage |
---|
Nginx configuration
If you also have Nginx locally, you can configure alist after Nginx, but it must be said that alist does not do a good job of proxying nginx and cannot use subpath, so it can only proxy /
, so the configuration of nginx is:
[root@liqiang.io]# cat /etc/nginx/nginx.conf
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Range $http_range;
proxy_set_header If-Range $http_if_range;
proxy_redirect off;
proxy_pass http://127.0.0.1:5244;
client_max_body_size 20000m;
}
Problem Solution
failed get storage: can’t find storage with rawPath: /
You may open this error page after installation, but it’s actually irrelevant, the key is that you need to click “Login” below to log in:
Figure 7:ignore the storage miss error |
---|