Since June 2022, Ubuntu has been the only operating system that I've used while working for Compositional IT.
In this post, I'll share some notes on how you can set up an Ubuntu environment for F# and SAFE Stack development. First off, I'll discuss why I use Ubuntu.
Why use Ubuntu at all
There are a variety of reasons why people might use Ubuntu. The main motivators for me are:
- I support the principle of free and open source operating systems, and want to be part of the user base.
- Ubuntu is the GNU/Linux operating system that I'm most familiar with.
- I prefer installing system programs via package manager, and the number of non-package-managed programs is vastly smaller in Ubuntu than Windows.
- I've been on a journey over the past few years to reduce my dependency on the mouse and increase my use of the keyboard. Linux apps tend to have keyboard users in mind more often than Windows apps, making keyboard use easier.
- I feel slightly weirded out by the amount of data that Microsoft collects when I use Windows.
- A solid understanding of Linux seems useful as more of the cloud moves to using it.
Dev environment setup
If you decide you want to use Ubuntu, the first thing you need to do is—of course—install it. The Ubuntu website has an installation tutorial. In the rest of this post, I'll assume that you have Ubuntu 22.04 installed.
- You need the .NET SDK. I recommend that you install the .NET SDK via the Microsoft package feed, because the version included in Ubuntu's regular package feeds is 6.0.1xx. 6.0.1 doesn't include some critical fixes for F#, such as the fix for a bug in
- If you're developing SAFE Stack apps, you'll also need node (I used the nodesource PPA option) and the Azure CLI.
- An IDE is highly recommended! I use Rider, but VS Code works too.
If you're running a production web application, chances are you'll want a database. For a lot of people working in the .NET ecosystem, that usually means SQL Server. Here are some tips:
- Install Docker.
- Run SQL Server in a Docker container (ideally your project has a Docker compose file referenced from your Build project).
- Install Azure Data Studio for connecting to databases and running queries against them (even ones running in Docker).
If you want to use SSDT database projects to version control your database schema (we do this at Compositional IT):
- Change your database project(s) to use the SDK style, referring to the Microsoft.Build.Sql SDK.
- Install the sqlpackage utility.
If you want to be able to deploy database changes via your FAKE build project, add a symlink from
/usr/local/bin/sqlpackage(where FAKE currently expects sqlpackage to be) to your sqlpackage install location (which you can find using
which sqlpackagein the terminal). For example, I ran
sudo ln -s /home/matt/.dotnet/tools/sqlpackage /usr/local/bin/sqlpackage
- Aside: before sqlpackage was available as a dotnet tool, I had some trouble using it when connecting to Docker containers ("an error occurred during the pre-login handshake"). As a workaround I would tweak my openssl configuration before deploying database changes, which was far from ideal. I no longer have to do this, but if you face an issue like this, feel free to reach out to me, for example via the F# Software Foundation Slack workspace.
Some of our apps read in or generate Excel files. So far, using LibreOffice Calc (usually installed by default) has worked fine for me. That said, something like editing a carefully formatted template file would make me nervous, and might make me reach for a Windows VM (which I haven't done as yet).
If you use EPPlus, you'll need to install its dependency libgdiplus:
sudo apt install libgdiplus.
If your team uses Microsoft Office for non-development activities, I've found the web versions to be sufficient.
You may occasionally need to remote into a Windows machine, for example an Azure VM. I use Remmina for this:
sudo apt install remmina remmina-plugin-vnc.
I'm really happy with my switch to Ubuntu, for the reasons above and more. If you're considering giving it a try for F# / SAFE Stack development, I hope that you are now confident that it's possible and that this post serves as a useful guide!