從大佬那學習到的安裝方法,記錄一下
準備工作
- ubuntu系統(tǒng)服務器
- 裝有Anaconda的容器
- 容器在run時做好的端口映射
jupyter notebook 安裝
登錄服務器
ssh root(ubuntu)@主機名(ip)
輸入服務器密碼
查看容器提前做好的端口映射
docker ps # 查看服務器內容器信息,記下提前映射好的端口號
進入容器
docker exec -it (CONTAINER ID) /bin/bash # 進入容器
生成jupyter notebook配置文件
jupyter notebook --allow-root --generate-config
創(chuàng)建存放jupyter notebook代碼的文件夾
cd / # 回到根目錄
mkdir 文件夾名 # 創(chuàng)建新文件夾
cd 文件夾名 # 進入新文件夾
啟動jupyter notebook
jupyter notebook --ip=0.0.0.0 --allow-root
如果想關閉終端后依舊在后臺運行,在命令前加上nohup即可。
打開jupyter notebook
在本地瀏覽器中輸入服務器主機ip:映射端口號,輸入密碼(token之后的數(shù)字字母序列)即可看到jupyter notebook頁面

密碼

jupyter notebook頁面
為了避免每次復制密碼,可以設置自己的密碼,點擊logout退出jupyter notebook,在一下頁面設置。注意,密碼設置需要重啟jupyter notebook才能生效。

更改密碼
參考文獻:
登錄服務器及一些操作
Dockerfile
ubuntu Anaconda 安裝jupyter notebook