Process of Installing Coolify on Debian in VirtualBox

Process of Installing Coolify on Debian in VirtualBox This document records the process of deploying Coolify after installing Debian in VirtualBox. Installing Debian 11 in VirtualBox is straightforward, so it will not be elaborated here. This article focuses on the detailed steps for deploying Coolify after the system installation is complete. 1. Enable SSH Service […]


Process of Installing Coolify on Debian in VirtualBox

This document records the process of deploying Coolify after installing Debian in VirtualBox.

Installing Debian 11 in VirtualBox is straightforward, so it will not be elaborated here. This article focuses on the detailed steps for deploying Coolify after the system installation is complete.

1. Enable SSH Service to Allow Root Login via SecureCRT

First, switch to the root account:

su

1.1 Update Debian Package Sources

apt-get update

1.2 Install SSH Service

apt-get install -y ssh

After installation, the SSH service starts automatically. You can also start it manually:

/etc/init.d/ssh start

1.3 Check SSH Service Status

/etc/init.d/ssh status

Example output:

root@debian:~# /etc/init.d/ssh status
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2022-03-11 10:47:15 CST; 2min 23s ago
Docs: man:sshd(8)
man:sshd_config(5)
Process: 1781 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Main PID: 1782 (sshd)
Tasks: 1 (limit: 2285)
Memory: 4.1M
CPU: 118ms
CGroup: /system.slice/ssh.service
└─1782 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups

1.4 Install VIM Editor

apt-get install -y vim

1.5 Back Up SSH Configuration File

cp /etc/ssh/sshd_config{,.bak}

1.6 Edit SSH Configuration File

Use VIM to edit the configuration file and replace the contents of /etc/ssh/sshd_config with the following:

vim /etc/ssh/sshd_config

Use the following command to verify the file content:

more /etc/ssh/sshd_config | grep -v "^#" | grep -v "^$"

Ensure it matches the following:

Include /etc/ssh/sshd_config.d/*.conf
Port 22
PermitRootLogin yes
PasswordAuthentication yes
PermitEmptyPasswords no
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server

You can also modify the file in VIM using insert mode and save with :wq.

1.7 Restart SSH Service and Configure Port Forwarding

/etc/init.d/ssh restart

Then go to the VirtualBox network settings. Set the network mode to NAT and configure the following port forwarding rules:

Name Protocol Host IP Host Port Guest IP Guest Port Notes
Rule1 TCP 192.168.56.1 22 10.0.2.15 22 SSH
Rule2 TCP 192.168.56.1 80 10.0.2.15 80 HTTP
Rule3 TCP 192.168.56.1 443 10.0.2.15 443 HTTPS
Rule4 TCP 192.168.56.1 8000 10.0.2.15 8000 HTTP access to the Coolify dashboard
Rule5 TCP 192.168.56.1 6001 10.0.2.15 6001 Real-time communications
Rule6 TCP 192.168.56.1 6002 10.0.2.15 6002 Terminal access

You can now remotely connect to this Debian system using SecureCRT or similar tools.


Notes: Fixing command not found Errors on Debian

Check whether the command is installed:

sudo apt update
sudo apt install # e.g. sudo apt install git or sudo apt install net-tools

Check and update the $PATH environment variable if the command is installed but not found:

echo $PATH

Permanently add a directory to PATH (append to ~/.bashrc):

nano ~/.bashrc

Add the following line if /sbin is missing:

export PATH="$PATH:/sbin"

Save and exit (Ctrl+OEnterCtrl+X), then reload:

source ~/.bashrc

2. Install Coolify

Open Required Firewall Ports

For self-hosted Coolify, ensure the following ports are open:

  • 8000 – HTTP access to the Coolify dashboard
  • 6001 – Real-time communications
  • 6002 – Terminal access (required for Coolify v4.0.0-beta.336 and above)
  • 22 – SSH access
  • 80 – SSL certificate generation via reverse proxy (Traefik or Caddy)
  • 443 – HTTPS traffic

Install UFW to avoid command not found errors:

sudo apt update
sudo apt install ufw
sudo ufw allow 8000
sudo ufw allow 6001
sudo ufw allow 6002

Ports 22, 80, and 443 are enabled by default.

Check firewall status:

sudo ufw status

Install curl

sudo apt update
sudo apt install curl

Install Coolify

curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash

Wait for the installation to complete.

After installation, open the browser and visit:

http://192.168.56.1:8000/

Create and activate your Coolify dashboard account.