Skip to content
RIPE NCC member · Local Internet RegistryCall us on 020 3318 3449sales@hosting-telecom.uk

FreeBSD 15 on a cloud server

A quick reference for FreeBSD 15.1: updating the system and software with pkg, services, the pf firewall, networking and support dates.

Contents

Our images use FreeBSD 15.1. This release is supported until 31 March 2027, and the whole 15 branch until the end of 2029, so before 2027 you will need to move to the next release in the branch. Log in as the freebsd user and run administrator commands with sudo. The default shell is sh.

Updating the system and software

In the image, the base system is installed as packages, so one command updates both it and your software:

sudo pkg update
sudo pkg upgrade

To see how your system is set up, run pkg which /usr/bin/uname. If the answer is a FreeBSD-… package, the system is package-based, as in our image. If it says “was not found in the database”, it is a classic installation (for example from an ISO): update the base system with sudo freebsd-update fetch install and the software with pkg upgrade.

Take a server snapshot before updating. For moving to a new release, follow the release announcement on freebsd.org.

Software

sudo pkg install nginxinstall
sudo pkg delete nginxremove; sudo pkg autoremove removes dependencies you no longer need
pkg search word, pkg infofind a package, list installed packages
sudo pkg audit -Fcheck whether your installed software has known vulnerabilities

Services and logs

sudo sysrc nginx_enable=YESstart the service at boot
sudo service nginx startstart it; also stop, restart, status
service -ewhich services are enabled
/var/log/messages, /var/log/auth.logthe system log and the login log

If the server’s clock drifts, turn on time synchronisation: sudo sysrc ntpd_enable=YES ntpd_sync_on_start=YES and sudo service ntpd start.

The pf firewall

pf is part of the system but is switched off. An example /etc/pf.conf that allows SSH, HTTP and HTTPS:

block in all
pass out all keep state
pass in proto tcp to port { ssh, http, https }
pass in inet proto icmp

Check the rules, then turn pf on:

sudo pfctl -nf /etc/pf.conf
sudo sysrc pf_enable=YES
sudo service pf start
Warning Turn pf on with the console in your control panel open: your current SSH connection may drop when it starts. If the rules lock you out, run sudo service pf stop in the console.

Network

The address and gateway are written to /etc/rc.conf when the server is created. To view them, use ifconfig and netstat -rn. After editing, apply the settings — preferably from the console rather than over SSH: sudo service netif restart && sudo service routing restart.

SSH

SSH is configured in a single file, /etc/ssh/sshd_config; FreeBSD has no sshd_config.d folder. To switch to key-based login and turn off passwords, see How to connect to your server over SSH.

Small things

  • Daily emails to root. Every night FreeBSD gathers system reports and emails them to root. To save them to files instead, add the lines daily_output="/var/log/daily.log", weekly_output="/var/log/weekly.log" and monthly_output="/var/log/monthly.log" to /etc/periodic.conf.
  • Default editor. If vi is unfamiliar, the system includes a simple editor called ee. To make it open by default, add the line export EDITOR=ee to ~/.profile.

To check the system version, run freebsd-version.

Didn’t find the answer? Ask our support team — we’ll help.

Choose which cookies we may use. You can change your mind at any time with the “Cookie settings” link at the bottom of every page.

Necessary

Always active

They keep the site secure and remember your cookie choice. They don’t identify you.

Google Analytics counts visits and shows which pages people find useful, so we can improve the site. Which cookies