安装步骤
- 下载 PocketBase:
wget https://github.com/pocketbase/pocketbase/releases/download/v0.x.x/pocketbase_0.x.x_linux_amd64.zip
注意:将 0.x.x
替换为最新的版本号。我安装的最新版本为 0.22.20
。
- 解压文件:
unzip pocketbase_0.x.x_linux_amd64.zip
- 移动到适当的目录:
sudo mv pocketbase /usr/local/bin/
- 设置执行权限:
sudo chmod +x /usr/local/bin/pocketbase
- 创建数据目录:
sudo mkdir /var/pocketbase
- 创建系统服务文件:
sudo nano /etc/systemd/system/pocketbase.service
在文件中添加以下内容:
[Unit]
Description=PocketBase service
After=network.target
[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/pocketbase serve --http="0.0.0.0:8090" --dir="/var/pocketbase"
Restart=on-failure
[Install]
WantedBy=multi-user.target
- 重新加载 systemd:
sudo systemctl daemon-reload
- 启动 PocketBase 服务:
sudo systemctl start pocketbase
- 设置开机自启:
sudo systemctl enable pocketbase
-
检查服务状态:
sudo systemctl status pocketbase
现在,PocketBase 应该已经在您的 Ubuntu 系统上运行,并监听在 8090 端口。您可以通过访问 http://your_server_ip:8090/_/
来访问 PocketBase 的管理界面。
Top comments (0)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.