Tips / Nginx

How to install Nginx on FreeBSD

Today we are going to see how to install nginx on FreeBSD servers. There are two ways to install Nginx on FreeBSD. The first one is installing using package system, and the second one is the ports system, the one we are going to use on this tutorial.

Let’s update the server’s port tree:

portsnap fetch update

Install nginx

cd /usr/ports/www/nginx
make config-recursive
make install clean

Now you should see a blue configuration screen, at this screen you should choose/select the additional modules you want to have compiled into nginx.

Add the service into rc.conf and start it:

echo 'nginx_enable="YES"' >> /etc/rc.conf
/usr/local/etc/rc.d/nginx start

Alright, now you should have Nginx working, browse your server IP or hostname and if you see the nginx welcome page that means your installation was successful.

Popular search terms:

  • nginx freebsd
  • nginx rc freebsd

Esteban Borges

Linux Geek, Webperf Addict, Nginx Fan. CTO @Infranetworking