Linux vs FreeBSD for Phoenix?


I saw that there’s a port for Elixir and Phoenix on FreeBSD.

Why would you want to run a Phoenix project on FreeBSD vs Linux?
Can you share your opinion please?

I’m trying to pick a deployment target and start learning about it.
Since Linux seems to be the default choice for servers, are there any reasons for choosing FreeBSD instead?


Personally I would stick with Linux unless:

  • You are already very familiar with FreeBSD
  • And you have a good reason to use FreeBSD

I don’t know of any proven benefits in using FreeBSD for Elixir projects.


As nearly always when it comes to the choice of an operating system, this choice might be driven by many different kind of “arguments”:

  • Personal matter
  • Personal experience
  • Policies of your Employer
  • Policies of your Client
  • Available ressources (there is this machine in that datacenter, which is running FBSD and monitored some internal stuff for the last year which we don’t need anymore, but we could run our new Phoenix-Page on it, but we can’t reinstall due to the fact that it is thousands of miles away)


Like the other people have said, unless you have a very specific reason to use FreeBSD I think it’s best to stick to Linux.


I was actually expecting some big arguments against using BSD, but since there seem to be none, I’ll give it a spin :slight_smile:
It’s going to be an adventure in uncharted waters for me, but I have high hopes that the buzz will be strong :005:


Please do report back :slight_smile:


Why do you want to use FreeBSD @Deithrian? Just curious :stuck_out_tongue:


@AstonJ I have emotional scars from trying to remove a video codec under Linux and watching the entire OS disappear in front of my eyes :icon_eek:
The bloody thing destroyed itself over a video codec…
I know I should read the deps and bla bla, but come on… that’s like uninstalling QuickTime on Windows and watching the uninstaller delete system32 :scream:

And so, BSD seems to be the second obvious choice for servers, plus no emotional scars there yet lol
I also saw a couple of talks on BSD and there’s a good amount of reasons for using it too.


What’s the TLDR/benefits on using FeeBSD (over Linux) @Deithrian?

Don’t you use the minimal Linux installs on your server? We use the minimal CentOS 7 image (minimal system with SSH daemon) on our new servers and just install what we need…


BSD is a port of Unix to the PC.
Linux is a unix-like emulator for the PC.

Splitting of hairs for the most part. /etc/rc.d/* vs inittab, jail vs virtualization, no run levels. In the end though csh works like csh on both platforms.

BSD would be just harder to maintain. Desktop builds such as PCBSD are a far cry from the user experience you get with modern linux distros.

FreeBSD was the mainstay of colocated machines back in the 90’s when everyone was running a DikuMUD. RedHat started making headway around 1999 or so.

Building up Centos minimal installs is what I’ve always done for deployed projects too. However the fact that ‘stable’ means things installed via yum and the Centos repo are a year behind gets aggravating. Often having to build things from source.

For development at home I choose Fedora for this very reason.


Thanks @Mandemus, so basically theres no real benefit and it becomes harder to maintain. I was expecting more. I guess perhaps it ‘might’ be a little more secure since it is not used as much?

Haha I hear you, but the upside is a rock solid system :003: I use Chruby for ruby versions and don’t mind the occasional building from source.


BSD is rock solid and secure. Not through obscurity but It’s having a long pedigree. It is as I said an actual port of AT&T’s System V Unix. Linux is merely a unix inspired workalike.

AIX on IBM Power hardware is prevalent in science and business, OsX on the Macintosh is also BSD.

I wanted to install two ubiquitous things last month. lftp and tmux. Both were like 5 minor versions behind. I run into that constantly with Centos. It makes the repo essentially a worthless exercise in frustration.

I get why they do it, stability. Still while I don’t need almost daily updates like with Fedora, but the way things are the Centos repo is always feeling ancient.


@AstonJ, well I’m really out of my depth here, but here’s what remained in my head after these talks.


  • Minor Updates don’t destroy your system. I had that happen with Linux, it didn’t even boot :slight_smile:
  • Binaries?! The speaker in the second talk said something about BSD providing binaries so he didn’t have to deal with dependency hell. Had bad experience with Linux there as well, compiled something, then it wanted different versions of other things, removed old versions and compiled new ones, then they needed different versions of other things, removing those other things = destroy the system.
  • The team takes care of the entire OS?!
  • In the first talk, it was mentioned that FreeBSD with version 11 will be massively scalable. I like that! Buzz words!
  • ZFS sounded nice, Jails sounded nice too.
  • It was mentioned that Netflix is contributing to BSD’s Net code.
  • Using something that’s not so popular, maybe another benefit for security?
  • The novelty of the experience :smiley:

I’ve only ever used BSD in the form of “PC-BSD” which says a lot, but even PC-BSD was so incredibly fast, I mean I was willing to put up with a “constant On laptop Fan” kind of fast :smile:
So I guess if all of the above is true, than I’m willing to give it a try :slight_smile: learning new things never hurts.


The good thing about FreeBSD it comes with an Elixir package, whereas Elixir is not available at all for my Linux distribution of choice, CentOS. Also WhatsApp runs Erlang on FreeBSD so I guess there’s an obvious connection there :wink:

Still, we’ve moved pretty much everything from FreeBSD to CentOS due to better support from (virtual) hardware vendors and some bad experiences running routine upgrades on FreeBSD. It’s a great OS though without the massive fragmentation that Linux has.


I was a rabid user of FreeBSD from my discovering it in the late 1990’s until about 2010. Around 2003, I started playing with DragonFly BSD. I used FreeBSD for desktop and server purposes.

I finally gave up on it. My workplace was/is deeply entrenched in Linux and I couldn’t convince anyone of the stability benefits. I don’t run much for servers and it was easier to install Ubuntu last time I got a new workstation.

In principle I like the BSD philosophy, but I’m a minority of one at work.

DragonFly has been fun to watch, and I still keep a machine or two running it. The hammer filesystem has some nice features. I won’t go into details here, but feel free to contact me offline if you want to know more.

In the end, I’m just glad to have something other than Windows to develop on.


Well, so far so good :slight_smile:
At least I know it’s possible to run a Phoenix project on the thing.

Basic installation notes:
-as root

  1. pkg install elixir
  2. pkg install node
  3. pkg install www/npm
  4. npm install -g npm

-as a user
5. ee ~/.login_conf
(remove # in front of lines)


-logout/login again

6.mix archive.install
7. mix projectname

-in project folder
8. mix deps.get
9. npm install
10. mix phoenix.server

Have not tried to install postgresql yet, not a fan of the “install this db” approach :confused:
Hopefully Phoenix will become more db agnostic :slight_smile:
Anyways, BSD doesn’t seem that scary at all!


It is not the “install this DB” approach. It is the “we support Postgres and mySQL out of the Box, if you want something else you have to implement an Adapter for it” approach.

Also as far as I know, there is a package out there that adds SQLite suport.

edit: Link to a tutorial that explains roughly how to implement an adapter


" Phoenix configures applications to use it(postgres) by default, but we can switch to MySQL by passing the --database mysql flag when creating a new application."
So that’s why you need to pass flags if you don’t want Postgres? That “default” word must be a typo there :stuck_out_tongue:

Ecto Models

Do I see four "SQL"s in the 5 models available? Thank God I can switch from one SQL to another SQL database. :slight_smile:
And there’s not even one Graph option?

I’m just kidding, I really am, but I think I have more reasons to stand on my opinion than switch to yours.
Thanks for the adapter tutorial link, most appreciated! :smiley:


Yeah, there are defaults, but they don’t enforce anything to you.

And of course you are right, currently there is an overwhelming majority of relational databases in there, thats just because the whole architecture of ecto is much more suitable to them. Its hard to wrap something else into it.

But of course, you may swap ecto with whatever you want.

Defaults are just a suggestion, to make it easier to people who want to stick with them, but you can override pretty much everything in Phoenix (except for Phoenix and Plug).

Another solution were to not provide any defaults, which would make it hard for beginners to get started and so removes the fun out of programming, which again is against the spirit of elixir.


Turns out for Graph, other people didn’t have much luck with making Ecto adapters, but there are option on the horizon :slight_smile: epic win community is epic win!