---
# System prepended metadata

title: opencti
tags: [專題]

---

> Opencti安裝
---

需要用到的工具
* VMware
* Ubuntu20.04
* docker
* docker-compose
* portainer
###### Ubuntu配置:Memory 8GB、Processors 4、Hard Disk 20GB 

**安裝Docker**
```
- sudo apt-get update 
- sudo apt-get upgrade
- curl -fsSL https://get.docker.com -o get-docker.sh
- chmod 777 ./get-docker.sh
- ./get-docker.sh
```

**運行Docker**
```
- docker -v
- systemctl enable docker.service
- systemctl enable containerd.service
- systemctl status docker
```

**安裝Portainer**
```
- sudo docker volume create portainer_data
- sudo docker run -d -p 18000:8000 -p 19000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
```
打開瀏覽器輸入`http://localhost:19000`或是`http://<虛擬機IP>:19000`

**使用Portainer建立OpenCTI**

* 建立並登入portainer admin帳號
![image](https://hackmd.io/_uploads/B1ZEkwcJ1e.png)
* 進入local環境後，建立STACK
![image](https://hackmd.io/_uploads/H1LOkP5yye.png)
* 選擇Web editer
* 複製貼上`docker-compose.yml`
![image](https://hackmd.io/_uploads/HJPfxD5kJe.png)
* 在下方上傳`.env`
    ###### 確保`docker-compose.yml`及`.env`在同一目錄下

    ![image](https://hackmd.io/_uploads/HyVKeD9kye.png)
點擊[https://www.uuidgenerator.net/?source=post_page]
生成一個UUID將他複製上`OPENCTI_ADMIN_TOKEN`，更改`MINIO_ROOT_USER`和`RABBITMQ_DEFAULT_USER`，minio密碼和RABBITMQ密碼也要做修改，修改完成後按下`Deploy the stack`接下來就耐心等待他創建堆疊，有點久是正常的


**打開OpenCTI**

* 在瀏覽器輸入`<虛擬機IP>:8080`，跳到以下畫面就代表安裝成功了
![image](https://hackmd.io/_uploads/SJek-Pqykl.png)


**參考資料**
https://www.youtube.com/watch?v=ri7GVk3RnEw&list=PLTe5jk_TBo6WvAW8KLDuAVu4yDlIoMDh0



