5
Service:Coder
Jeffery edited this page 2026-05-20 08:43:24 +00:00

安裝 Coder

curl -L https://coder.com/install.sh | sh

修改 Coder 綁定的位址

echo 'export CODER_HTTP_ADDRESS=0.0.0.0:3000' >> ~/.bashrc && source ~/.bashrc

啟動 Coder 服務

systemctl enable --now coder

使用

sudo -u postgres psql

新建使用者與資料庫

CREATE USER coder WITH PASSWORD 'coder';

CREATE DATABASE coder;

設定資料庫權限

-- 1. Give ownership of the database to the app user
ALTER DATABASE coder OWNER TO coder;

-- 2. Give ownership of the public schema to the app user
ALTER SCHEMA public OWNER TO coder;

-- 3. Ensure the user has create permissions (Crucial for Postgres 15+)
GRANT USAGE, CREATE ON SCHEMA public TO coder;