找到服务配置

systemctl status jenkins


编辑配置

sudo vi /lib/systemd/system/jenkins.service

修改其中的端口信息

Environment="JENKINS_PORT=8080"

使其生效

sudo systemctl daemon-reload
sudo systemctl restart jenkins