不废话,直接上干货,适合新手安装,代码直接逐行复制粘贴就行。
安装Docker
首先安装下面程序之前,需要在服务器上安装Docker
环境,使用命令:
#centos 6系统
rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum update -y
yum -y install docker-io
service docker start
chkconfig docker on
#CentOS 7、Debian、Ubuntu系统
curl -sSL https://get.docker.com/ | sh
systemctl start docker
systemctl enable docker
安装Qbittorrent
先安装Docker
,然后执行以下命令:
docker run --restart=always --name qbittorrent -d \
-p 6881:6881 \
-p 6881:6881/udp \
-p 8080:8080 \
-v ~/qbittorrent/config:/config \
-v ~/qbittorrent/downloads:/downloads \
linuxserver/qbittorrent
安装完成后,相关信息如下:
qbittorrent地址:http://ip:8080
用户名:admin
密码:adminadmin
配置和/下载目录:~/qbittorrent
CentOS
系统安装后,可能还需要开启相应的端口,大致如下:
#CentOS 6
iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
iptables -A INPUT -p tcp --dport 6881 -j ACCEPT
iptables -A INPUT -p udp --dport 6881 -j ACCEPT
service iptables save
service iptables restart
#CentOS 7
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --zone=public --add-port=6881/tcp --permanent
firewall-cmd --zone=public --add-port=6881/udp --permanent
firewall-cmd --reload
如果你不想用了,可以使用以下命令卸载:
#删掉容器
ContainerID=`docker ps|grep linuxserver/qbittorrent|awk '{print $1}'`
docker kill ${ContainerID}
docker rm ${ContainerID}
docker rmi `docker images|grep linuxserver/qbittorrent|awk '{print $3}'`
#删掉下载文件夹
rm -rf ~/qbittorrent
大盘鸡链接:
未经允许不得转载:DPP博客 » linux系统安装Qbittorrent