The FreeBSD way of installing software is using either pkg or port.
Pkg consists of pre-compiled binaries from a central repository of assumed “safe” code, while Ports are source code FreeBSD downloads and compiles for you.
Both distribution (distro) methods check for GPG signatures, and install prerequisites. I’d recommend installing Perl for yourself first, as this requires a slight nuance.
If you already have a Perl you like installed, go ahead and install the Webmin/Usermin/Virtualmin combo using either of the methods below:
Run the below commands either using sudo, or the more “BSD” method of using su to root.
Pkg:
pkg install sysutils/webmin
pkg install sysutils/usermin
pkg install sysutils/virtualmin
Port:
cd /usr/ports/sysutils/webmin/ && make install clean
cd /usr/ports/sysutils/usermin/ && make install clean
cd /usr/ports/sysutils/virtualmin/ && make install clean
No need to document this, it’s already well documented at FreshPorts, and the Perl install via rmake.conf is also widely documented, search google for this too.
First, check the “current” supported versions of perl: https://www.freshports.org/search.php?query=perl5
Usually, it’s best to go with the highest supported number.
Installing PERL requires changing an environment variable in your /etc/make.conf
Please add the “perlX=X.xx” variable to your DEFAULT_VERSIONS if it exists, and add the DEFAULT_VERSIONS flag if it does not.
In my case, I wanted to use Perl 5.36, which is current as of the time of this post. MY DEFAULT_VERSIONS line looks like this:
DEFAULT_VERSIONS+=perl5=5.36 python=3.11 python3=3.11 php=php8.2 ruby=3.2
This tells make that it needs to add symlinks to standard system locations after installation.
Then, once that’s done, you can install perl from the “meta-port” and it will install all the files, and symlinks into the correct places using:
pkg:
pkg install lang/perl5.36
port:
cd /usr/ports/lang/perl5.36/ && make install clean
Once you’re all installed, go ahead and check the default locations of servers & config files for the modules you intend to use. Most non-core services will need to be configured to the “userland” directories /usr/local/ and the subsequent directories therein.
The above is pretty much standard for installing anything on FreeBSD, and would appear as straight-forward advice to most FreeBSD regulars.
That being said, please remit all configuration changes – Joe might be moved to add a default FreeBSD flag that tells Webmin & the family where the standard “user land” locations are for the necessary applications that are usually not installed by OS in BSD’s.
Webmin has been in continual use on our FreeBSD machines for over 20 years, and I’d recommend it highly.
PS – if you have an old Perl, you can find and delete it using pkg, even if it was installed by a port, all software registers through the pkg manager.
If it’s your first time using ports, you’ll need to install and configure a few things, BSD will walk you through it.
Never ignore the output of a make – it has most of the hints you need to solve problems.
PSS - the “FreeBSD” way of saying all of the above would normally be to direct you to the pages where this information is found on FreeBSD source sites – however since this is Virtualmin site, we’ll do this the Virtualmin way and actually document in-thread.