Manual installation on FreeBSD
System requirements
- At least 1GB of RAM
- FreeBSD with release >= 14.0
- ARM64 or AMD64 architecture
- CTFreak configuration folder must not be located on a network drive
- An active internet connection during installation
- An active internet connection for at least 2 hours per day to allow license check (only required for the STARTUP & PRO Edition)
Installing
To install CTFreak as a service, we will rely on rc.d.
Copy latest ctfreak
binary to /usr/local/bin
and make the file executable:
sudo curl https://ctfreak.com/download/release/latest/freebsd/amd64 --output /usr/local/bin/ctfreak
# OR "sudo curl https://ctfreak.com/download/release/latest/freebsd/arm64 --output /usr/local/bin/ctfreak" for ARM64 architecture
sudo chmod +x /usr/local/bin/ctfreak
Create rc.d service file:
sudo touch /usr/local/etc/rc.d/ctfreak
sudo chmod 755 /usr/local/etc/rc.d/ctfreak
Create/Choose a user account to run CTFreak, we’ll call it myuser
for now
Edit /usr/local/etc/rc.d/ctfreak
(replace myuser
with your real user):
#!/bin/sh
#
# PROVIDE: ctfreak
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
. /etc/rc.subr
ctfreak_runAs="myuser"
name="ctfreak"
rcvar="ctfreak_enable"
pidfile="/var/run/${name}.pid"
# Env Setup
export HOME=$( getent passwd "$ctfreak_runAs" | cut -d: -f6 ) # Gets the home directory of the runAs user
command="/usr/sbin/daemon"
command_args="-r -t CTFreak -u ${ctfreak_runAs} -o /var/log/${name}.log -P ${pidfile} /usr/local/bin/ctfreak run"
load_rc_config $name
: ${ctfreak_enable="NO"}
run_rc_command "$1"
Enable & start CTFreak:
sudo service ctfreak enable
sudo service ctfreak start
At startup, CTFreak will create its dedicated config folder $HOME/.config/ctfreak
to store its configuration file, embedded database and log files.
Navigate to http://localhost:6700.
Log in with the default user: admin / password: ctfreak.
To complete this installation, we encourage you to configure a reverse proxy and update the global settings.
Upgrading
Update /usr/local/bin/ctfreak
with new binary and restart the service:
sudo curl https://ctfreak.com/download/release/latest/freebsd/amd64 --output /usr/local/bin/ctfreak
# OR "sudo curl https://ctfreak.com/download/release/latest/freebsd/arm64 --output /usr/local/bin/ctfreak" for ARM64 architecture
sudo service ctfreak restart
Uninstall
Execute:
sudo service ctfreak stop
sudo service ctfreak disable
sudo rm /usr/local/etc/rc.d/ctfreak
sudo rm /usr/local/bin/ctfreak