1Panel is a modern, open-source server management panel designed for simplicity, efficiency, and ease of use. It allows you to manage Linux servers and deploy web applications via a user-friendly web interface. With support for Docker, domain binding, SSL certificates, and multiple app templates, 1Panel is perfect for developers, startups, and sysadmins looking to streamline server management.
OneDev is an all-in-one DevOps platform that provides Git repository hosting, CI/CD pipelines, issue tracking, code review, and a powerful self-hosted development workflow. Think of it as a private GitHub + GitLab + Jenkins combo, ideal for teams or solo developers who want full control over their infrastructure.
By deploying OneDev via 1Panel, you get the best of both worlds:
- 1Panel handles server and Docker container management with SSL and domain integration.
- OneDev manages your codebase, automates deployments, and provides developer tools—all in a private, secure environment.
This guide walks you through deploying OneDev on your server using 1Panel with zero downtime and optimal configuration.
WittyAi was here
Follow the instructions provided in this GitHub issue to install OneDev using the Docker container method.
Once installed:
- Set up SSL certificates.
- Assign your custom domain (e.g.,
onedev.youramazingdomain.com
). - Create your admin credentials.
- Import all your project repositories from GitHub, GitLab, etc.
WittyAi was here
Open the 1Panel web portal, then navigate to:
Containers → OneDev-Container → Terminal → Connect
Run the following command in the terminal to create a new SSH key:
ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/onedev-container
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/onedev-container
Open the SSH config file:
nano ~/.ssh/config
Then add the following configuration:
Host onedev.youramazingdomain.com
Port 2086 # Replace with your actual SSH port
User onedev-container
IdentityFile ~/.ssh/onedev-container
IdentitiesOnly yes
Verify the SSH connection:
ssh -T onedev.youramazingdomain.com
Display the public key:
cat ~/.ssh/onedev-container.pub
- Go to
onedev.youramazingdomain.com
- Click Profile → SSH Keys
- Click the ➕ icon
- Paste the copied SSH key
- Save
Do not forget to update your port
git clone ssh://onedev.youramazingdomain.com:2086/your-amazing-repo
Your OneDev container SSH key setup is complete.
WittyAi was here
Open the 1Panel web portal, then navigate to:
Containers → OneDev-Container → Terminal → Connect
Run the following command in the terminal to create a new SSH key:
ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/development-pc
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/development-pc
Open the SSH config file:
nano ~/.ssh/config
Then add the following configuration:
Host onedev.youramazingdomain.com
Port 2086 # Replace with your actual SSH port
User development-pc
IdentityFile ~/.ssh/development-pc
IdentitiesOnly yes
Verify the SSH connection:
ssh -T onedev.youramazingdomain.com
Display the public key:
cat ~/.ssh/development-pc.pub
- Go to
onedev.youramazingdomain.com
- Click Profile → SSH Keys
- Click the ➕ icon
- Paste the copied SSH key
- Save
Do not forget to update your port
git clone ssh://onedev.youramazingdomain.com:2086/your-amazing-repo
Your Development PC's SSH key setup is complete.
WittyAi was here
- Go to
onedev.youramazingdomain.com
- Go to Administration → Agents → ➕ (Plus Icon)
- Select the tab Run on Bare Metal / Virtual Machine
- Download either
agent.zip
oragent.tar.gz
Make sure you are logged in with root privileges.
mkdir -p /opt/onedev-agent
- Connect to your server using your preferred FTP application
- Navigate to:
/opt/onedev-agent
- Upload and extract
agent.zip
oragent.tar.gz
- Ensure the contents are located in
/opt/onedev-agent
chmod +x bin/agent.sh
WittyAi was here
sudo nano /etc/systemd/system/onedev.service
[Unit]
Description=OneDev Agent Service
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/onedev-agent
ExecStart=/opt/onedev-agent/bin/agent.sh start
ExecStop=/opt/onedev-agent/bin/agent.sh stop
Restart=always
RestartSec=5
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=onedev-agent
[Install]
WantedBy=multi-user.target
Press
Ctrl + X
, then pressY
to save and exit.
sudo systemctl daemon-reload
sudo systemctl start onedev
sudo systemctl enable onedev
sudo systemctl status onedev
- Go to
onedev.youramazingdomain.com
- Navigate to Administration → Agents
- Your agent should appear with your server's hostname, IP address, and Status: Online
You’ve successfully completed the OneDev Agent Setup on your server! 🚀
WittyAi was here
- Go to
onedev.youramazingdomain.com
- Navigate to Administration → Job Executor
- Click Add Executor
- Choose Remote Sheel Executor
- Give a name like deploy, deployment, zero-down-time-deployment
- Set your agent selector theme like this "Name" is "Your Server's Hostname" you will be able to choose your server hostname there it is automatically fetch that info from the agent section.
- Click Test
- test it with
/opt/onedev-agent
- You must see the response Job executor tested successfully
- Save the Job Executor
WittyAi was here
mkdir -p your-1Panel-folder-path/apps/temp-git
and
mkdir -p your-1Panel-folder-path/apps/overlays
Use overlays folder for your development environment and production envriment files which needs replaced after cloning
WittyAi was here
- Go to
onedev.youramazingdomain.com
- Navigate to Projects → Choose your amazing repo
- Create .onedev-buildspec.yml
- Click Add new
- Name it Deploy to Server
- On the section of Job Executor write your job executor name which did you named previously deploy, deployment, zero-down-time-deployment
- Come to the steps section press plus icon
- Search for execute commands and choose it
- Give a name you can use your repo's name
- Disable run in container
- Interpreter must be selected default
- Condition must be selected successful
- Add your codes in Commands section find the example setup below
#!/bin/bash
echo "🚀 Zero Downtime Deployment has started..."
# === CONFIGURATION ===
TEMP_DIR="your-1Panel-folder-path/apps/temp-git"
REPO_NAME="your-amazing-repo"
TIMESTAMP=$(date +"%Y%m%d-%H%M%S")
CLONE_DIR="$TEMP_DIR/${REPO_NAME}-${TIMESTAMP}"
TARGET_DIR="your-1Panel-folder-path/apps/openresty/openresty/www/sites/your-amazing-website.com/index"
REPO_URL="ssh://onedev.youramazingdomain.com:2086/your-amazing-repo"
MAX_VERSIONS=3
# === ENSURE TEMP DIR EXISTS ===
echo "📁 Ensuring temp directory exists: $TEMP_DIR"
mkdir -p "$TEMP_DIR"
# === CLONE REPO WITH TIMESTAMP ===
echo "📥 Cloning into: $CLONE_DIR"
git clone --depth=1 "$REPO_URL" "$CLONE_DIR"
# === VERIFY CLONE SUCCESS ===
if [ ! -d "$CLONE_DIR" ]; then
echo "❌ Clone failed. Aborting deployment."
exit 1
fi
# === REMOVE UNWANTED DOTFILES FROM TARGET (KEEP .env) ===
echo "🧹 Removing unwanted hidden files from live directory (excluding .env)..."
# Remove dotfiles (files) except .env
find "$TARGET_DIR" -maxdepth 1 -type f -name ".*" ! -name ".env" -exec rm -f {} \;
# Remove dotfolders (directories) except .env (not needed if .env is a file)
find "$TARGET_DIR" -maxdepth 1 -type d -name ".*" ! -name "." ! -name ".." ! -name ".env" -exec rm -rf {} \;
# === SYNC TO LIVE DIRECTORY (EXCLUDE DOTFILES FROM SOURCE) ===
echo "📂 Syncing clean files to live directory..."
rsync -av --delete \
--exclude='.*' \
--exclude='*/.git/' \
"$CLONE_DIR"/ "$TARGET_DIR"/
# === CLEANUP OLD CLONES (KEEP ONLY LAST 3) ===
echo "🗑️ Checking for old versions to delete..."
cd "$TEMP_DIR" || exit 1
ls -dt ${REPO_NAME}-* 2>/dev/null | tail -n +$((MAX_VERSIONS + 1)) | while read -r old_dir; do
echo "🗑️ Removing old clone: $TEMP_DIR/$old_dir"
rm -rf "$TEMP_DIR/$old_dir"
done
# === DONE ===
echo "🎉 Deployment completed successfully to: $TARGET_DIR"
By completing this setup, you've established a secure, scalable, and self-hosted CI/CD environment using 1Panel and OneDev.
Your organization now benefits from:
- ✅ Zero-downtime deployments — ensure continuous service availability without disrupting users.
- 🔐 Full control over your source code and pipelines — enhance codebase security and meet compliance standards.
- 💸 Significant cost savings — eliminate reliance on expensive third-party CI/CD platforms, saving thousands annually.
- 🚀 Scalable DevOps workflow — customize and grow your infrastructure on your terms.
This setup gives your team the power to ship faster, safer, and smarter—without vendor lock-in.
WittyAi was here
Need a robust, secure CI/CD environment tailored to your organization's needs?
We offer enterprise consulting, including:
- Custom CI/CD pipeline design (leveraging Agile methodologies and systems engineering expertise)
- Secure infrastructure setup (certified in data protection, EU/UK GDPR, and TS EN 50600 standards)
- Advanced networking integration (expertise in complex network design and management)
- Big data & analytics optimization (skilled in managing and analyzing large datasets)
- Leadership & team enablement (support with communication, mentoring, and collaboration strategies)
- Version control solutions (proficient in Git and GitHub for effective code management)
📩 Contact us:
For pricing and consultation based on your specific requirements, reach out to: