- 我的环境
- 操作步骤
- 其他
腾讯云云服务器
操作系统Ubuntu Server 20.04 LTS 64位
配置时间在21年10月
- 下载Anaconda安装包
登录云服务器,从清华镜像源找到合适的Anaconda安装包,使用wget命令下载
清华镜像源:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
笔者选择的是Anaconda3-2021-Linux-x86_64.sh
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2021.05-Linux-x86_64.sh
- 安装Anaconda
使用sh命令,一路yes无脑安装
sh Anaconda3-2021-Linux-x86_64.sh
- 生成jupyter notebook配置文件
jupyter notebook --generate-config
运行后在/home/ubuntu生成.jupyter目录
- 修改配置文件
vim .jupyter/jupyter_notebook_config.py
初始时里面所有内容都是注释掉的,在配置文件里面添加:
c.NotebookApp.ip = '*' c.NotebookApp.open_browser = False c.NotebookApp.port = 8888
- 后台运行jupyter notebook
nohup jupyter notebook &
查看jupyter notebook相关进程,关闭进程
ps -aux | grep jupyter kill -9 pid
- 然后就可以在本地浏览器使用公网IP:8888远程访问云服务器上的jupyter notebook啦
- 可以设置密码登录,可以参考这个博客https://cloud.tencent.com/developer/article/1194200
- 遇到一直显示密码invalid的情况,可以强行重置密码
jupyter notebook password



