How to install Webmin on OPNSense

How to install Webmin on OPNSense

Webmin is not part of the OPNSense repository packages, however as OPNSense is more vanilla FreeBSD than pfSense it is relatively east to install additional packages.

For compatibility and stability reasons the FreeBSD repository is disabled by default, but it can be enabled by editing the /usr/local/etc/pkg/repos/FreeBSD.conf file and changing no to yes:

FreeBSD: { enabled: yes }

Running pkg install packagename now will allow the installation of any FreeBSD package.
Be careful though, as some packages (or dependency packages) may replace OPNSense’s own packages and break it. Limit the installation to packages that do not replace anything. Remember to turn the option back to ‘no’ when you’re done.

To install Webmin on OPNSense, run:

pkg update
pkg install webmin
/usr/local/lib/webmin/setup.sh
echo "webmin_enable="YES"" >> /etc/rc.conf
/usr/local/etc/rc.d/webmin start

If you get an error about Webmin requesting perl location and the default does not work, create a symlink to the latest installed binary (all versions currently installed are available in /usr/local/bin/), for example:

ln -s /usr/local/bin/perl5.26.1 /usr/local/bin/perl

You may need to redo this after perl updates.

Leave a Reply