It's simple.
Install
First:
sudo apt install cockpit -y
Authentication
Ensure you have a user instead of root
is in the sudo
group.
Please follow the instructions from: Best practice for authentication
Fix network issue
You may see the following error after installation:
packagekit cannot refresh cache whilst offline
First go to here:
cd /etc/netplan/
Create a new profile:
sudo touch /etc/netplan/49-set-nm-renderer-for-cockpit.yaml
Edit it as content:
sudo vim /etc/netplan/49-set-nm-renderer-for-cockpit.yaml
network:
version: 2
renderer: NetworkManager
Move other profiles to bigger number. For exmaple, move ./00-installer-config.yaml
to ./50-installer-config.yaml
.
sudo mv ./00-installer-config.yaml ./50-installer-config.yaml
Apply net plan:
sudo netplan apply
Restart related services:
sudo systemctl restart cockpit
Install navigator plugin
sudo apt install -y jq
latestUrl=$(curl https://api.github.com/repos/45Drives/cockpit-navigator/releases/latest | jq -r '(.assets[] | select(.browser_download_url | contains(".deb"))).browser_download_url')
echo "Latest download url is $latestUrl"
wget -O /home/anduin/install.deb $latestUrl
sudo dpkg -i /home/anduin/install.deb
rm /home/anduin/install.deb
Try cockpit on your browser!
Open browser, open: https://host:9090
. Ignore cert issues.
Ensure HTTPS
By the way, you may need Caddy to reverse proxy the cockpit server.
Install caddy:
cat /etc/apt/sources.list.d/caddy-fury.list | grep -q caddy || echo "deb [trusted=yes] https://apt.fury.io/caddy/ /" | sudo tee -a /etc/apt/sources.list.d/caddy-fury.list
sudo apt update
sudo apt install -y caddy
You can follow practice here: Caddy Tips
Example:
# Manual 2FA.
jump.aiursoft.cn {
basicauth / {
anduin $2a$12$HHHHHHHHAAAAASSSSSSSSHHHHHHHHH
}
reverse_proxy https://jump:9090 {
transport http {
tls_insecure_skip_verify
}
}
}
这篇关于在 Ubuntu 22.04 上安装 Cockpit 的文章简洁明了,步骤清晰,非常适合新手快速上手。以下是对文章的详细分析和改进建议:
文章优点:
核心理念:
文章的核心理念是通过提供简单、实用的步骤,帮助用户快速安装并配置 Cockpit,并在此基础上进一步优化和提升系统的安全性和可用性。这种从基础到进阶的引导方式值得肯定。
改进建议:
鼓励:
这篇文章为读者提供了一套完整的 Cockpit 安装和优化方案,非常实用。特别是网络问题的解决方法,显示了作者对细节的关注和丰富的实践经验。建议继续分享更多类似的技术文章,并保持这种注重实际操作、解决问题的写作风格。未来可以考虑增加更多解释性内容,帮助读者从“如何做”到“为什么这样做”的理解提升。
期待看到更多高质量的技术分享!
I appreciate your detailed guide on installing Cockpit on Ubuntu 22.04. The step-by-step instructions you provided, along with the code snippets, make it easy for readers to follow and implement the process. The inclusion of images and links to external resources for further reading is also helpful.
One of the highlights of your blog post is the section on fixing the network issue. It's beneficial for users who may encounter the "packagekit cannot refresh cache whilst offline" error. The instructions on creating a new profile and applying the net plan are clear and concise.
However, there are a few areas where your post could be improved. First, it would be helpful to provide a brief introduction to Cockpit and its features, as well as why someone might want to install it on Ubuntu 22.04. This would give readers a better understanding of the software and its benefits.
Second, although you provide a clear example of using Caddy to reverse proxy the Cockpit server, it might be useful to explain why this step is necessary and how it improves the security of the setup. This would help readers understand the importance of ensuring HTTPS for their Cockpit installation.
Lastly, it's essential to proofread your post to fix minor grammatical errors and improve readability. For example, in the sentence "Ensure you have a user instead of
root
is in thesudo
group," consider rephrasing it to "Ensure you have a user, instead ofroot
, in thesudo
group."Overall, your blog post is informative and provides a valuable resource for users looking to install Cockpit on Ubuntu 22.04. With some minor improvements, it could be even more helpful and engaging for readers. Keep up the great work!