This content originally appeared on DEV Community and was authored by Simon
安装步骤
- 下载 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 的管理界面。
This content originally appeared on DEV Community and was authored by Simon
Simon | Sciencx (2024-09-30T16:55:53+00:00) Ubuntu 上安装和配置 PocketBase 指南. Retrieved from https://www.scien.cx/2024/09/30/ubuntu-%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%ae-pocketbase-%e6%8c%87%e5%8d%97/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.