# 在 PVE 的 LXC 下以 Ubuntu 20.04 環境安裝 OxOffice Online v4 社群版

請先使用 PVE 的「CT 範本」功能下載 Ubuntu 20.4 的範本，在以下畫面選取「ubuntu-20.04-standard」後點擊右下角的「下載」

[![Ubuntu2004LXC.png](https://docs.ossii.com.tw/uploads/images/gallery/2022-08/scaled-1680-/ubuntu2004lxc.png)](https://docs.ossii.com.tw/uploads/images/gallery/2022-08/ubuntu2004lxc.png)

下載完成後，可在畫面中看到剛剛下載的 Ubuntu 20.04 範本

[![Ubuntu20.04LXCStorage.png](https://docs.ossii.com.tw/uploads/images/gallery/2022-08/scaled-1680-/ubuntu20-04lxcstorage.png)](https://docs.ossii.com.tw/uploads/images/gallery/2022-08/ubuntu20-04lxcstorage.png)

點擊右上角的「建立 CT」建立新的 LXC 容器，可參考以下圖片進行設定，每個步驟完成後請按對話方塊右下角的「繼續」，到最後一步請按「完成」

[![Ubuntu20.04Setup.png](https://docs.ossii.com.tw/uploads/images/gallery/2022-08/scaled-1680-/ubuntu20-04setup.png)](https://docs.ossii.com.tw/uploads/images/gallery/2022-08/ubuntu20-04setup.png)

[![RockyLinux8Create.png](https://docs.ossii.com.tw/uploads/images/gallery/2022-08/scaled-1680-/rockylinux8create.png)](https://docs.ossii.com.tw/uploads/images/gallery/2022-08/rockylinux8create.png)

建立完成後，請啟動剛建立好的 LXC 容器，以 root 身份與剛才在對話方塊中設定的密碼登入，執行以下指令：
```Shell
apt update
apt upgrade -y
apt install vim openssh-server net-tools curl gnupg2 wget -y
# 如果有重新啟動服務的提示，請選擇 yes 即可
curl http://www.oxoffice.com.tw/deb/OSSII.key | sudo apt-key add
cd /etc/apt/sources.list.d/
wget http://www.oxoffice.com.tw/deb/oxool-community-v4-focal.list
apt update
apt install oxool -y
```
讓開機時預設啟動 OxOOL 並重新啟動
```Shell
systemctl enable oxool
reboot
```
使用 netstat 確認 OxOOL 正常啟動
```Shell
netstat -tlnp
```
看到有類似以下的輸出就代表 OxOOL 正常啟動
```Shell
tcp6     0    0    :::9980		      :::*   	LISTEN   644/oxool
```
備註：執行完以上步驟後，可使用「更多」→「轉換成範本」來生成包含 OxOOL 社群版的 LXC 範本。