How To Setup an Intel NUC Development Machine

I recently got ahold of two Intel NUC 6s that had seen better days. Since they were free, I figured that I might as well take them home and see if I could get them running. Luckily, a quick SSD replacement worked. While I’ve worked with NUCs a lot in the past, all of that work has been related to my job, so I haven’t been able to just take a NUC, load whatever I want onto it, and test new projects. Also, I’ve seen homelab discussions that mention NUCs as good starting hardware.

Once I got the NUCs up and running, I decided to document my process from turning a blank slate NUC into a Linux homelab. Bear in mind that I wouldn’t actually call this a homelab yet. Right now, these steps will just help you install an OS and some tools (Docker, Sublime Text, etc.) and setup an SSH server. I may add more documentation as I build up my homelab’s functionality.

Step 1: Install Ubuntu on your NUC

To install Ubuntu on my NUC6, I simply used a Macbook and a USB flash drive. This is a relatively easy process, and Ubuntu has documented it here. Note that Ubuntu recommends using older versions Ubuntu Desktop for NUC7s, but I was able to install a current version of Ubuntu on my NUC6. As of 2024, it seems that current versions of Ubuntu should work on older NUC models. Also note that this guide is only useful if you are using a Mac system to write Ubuntu to a flash drive. If you’re using Windows, take a look at this article.

    1. Download an image of Ubuntu Desktop. I used 22.04.2 LTS.
    2. Download Balena Etcher.
    3. Erase and reformat your USB flash drive. On Mac, this can be done by launching Disk Utility, erasing the flash drive, and formatting it as MS-DOS (FAT), as detailed in this post.
    4. Open Balena Etcher
      • Click “Flash from file” and select the recently Ubuntu Desktop Image.
      • Click “Select target” and select your newly reformatted flash drive.
      • Click “Flash!”. The flashing process will take a few minutes.
    5. Now that you have a bootable flash drive, plug your it into the USB port on your NUC, and connect your monitor, keyboard, and mouse.
    6. Power on the NUC, and press F10 until you are prompted to choose a boot option.
    7. Select the USB as the boot option. The boot process will begin and take some time.
    8. Once you select your language, WiFi, etc., you’ll be asked to set your hostname and password.
    9. Wait for the installation process to complete. When it’s done, you’ll be asked to use your password to login.

    You’re done! You now have a usable NUC with Ubuntu installed! Now, let’s get it setup to be a development machine.

    Step 2: Install Docker on your NUC

    Now that you’ve installed Ubuntu on your NUC, you’re ready to set up your homelab! Let’s start by installing Docker Desktop. I’ve distilled the steps from Docker’s guide below, but you can still reference it here.

    1. Set up Docker’s package repository.
      • Open a terminal on your NUC.
      • Update the apt package index and install packages to allow apt to use a repository over HTTPS by running the following commands:
        $ sudo apt-get update
        $ sudo apt-get install ca-certificates curl gnupg
      • Add Docker’s official GPG key by running the following commands:
        $ sudo install -m 0755 -d /etc/apt/keyrings
        $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
        $ sudo chmod a+r /etc/apt/keyrings/docker.gpg
      • Use the following command to set up the repository:
        $ echo \
        "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] \
        https://download.docker.com/linux/ubuntu \
        "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
        sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
      • Update the apt package index: $ sudo apt-get update
    2. Download latest DEB package from Docker’s Website.
    3. Install the package with apt as follows:
      • In gnome-terminal, access your Downloads folder i.e. $ cd Downloads
      • Run the following commands:
        $ sudo apt-get update
        $ sudo apt-get install ./docker-desktop
    4. Docker Desktop is now successfully installed. To launch the application, run:
      $ systemctl --user start docker-desktop
    5. Once the application has started, drag it into your favorites side panel.

    Step 3: Install a text editor on your NUC

    Now that your system is ready for containers, we need an IDE to work in (unless you want to use VIM or nano). In my homelab, I use Sublime Text as a lightweight text editor, but feel free to use what you’re most comfortable with (i.e VSCode).

    Install and Launch Sublime Text:

    1. On your NUC, download the Sublime Text 64 bit.deb file from here.
    2. Open the Ubuntu file explorer and double click the downloaded DEB file.
    3. Follow the installation process.
    4. Click the “Show Applications” tile in the bottom left of your screen and search for Sublime Text.
    5. Launch Sublime Text and drag the app to your favorites.
    6. Sublime Text is now installed and easily accessible.

    Step 4: Create an SSH connection between your local machine and your development NUC

    Sometimes, you may want to push applications to, write scipts on, or remotely start containers on your NUC while you’re not able to access it in-person, but you are connected to your home network. SSH allows you to do this remotely. In this process, you will create two SSH keys: a private key and a public key. The private key will live on your local machine (your Macbook), and it will allow you to remotely connect to your remote machine (your NUC). The public key will live on your remote machine (your NUC). This guide is very similar/almost exactly the same as Derek Siver’s combined with this Digital Ocean guide. Feel free to reference those guides, if you please!

    1. On your Macbook, open a terminal and run $ ssh-keygen -t ed25519 to create SSH keys with the Ed25519 protocol.
    2. You will then be prompted to provide a file path and name to the keys: $ /Users/yourname/.ssh/id_ed25519
      • I recommend using the default path/name Users/yourname/.ssh/id_ed25519. If you also prefer to use the default, press [enter].
      • If you prefer to give the keys a different name, enter: $ /Users/yourname/.ssh/<key-name> and press [enter].
    3. You will then be prompted to provide a passphrase: Enter passphrase (empty for no passphrase):. If you don’t want to use a passphrase, press [enter] twice.
    4. You now have your public and private key. Verify this by going to /Users/yourname/.ssh/ in your local files. You should see two files: id_ed25519.pub and id_ed25519.
      • Note: In Finder, files begining with a period are hidden by default. To enable hidden file viewing, press: ⌘-⇧-.
    5. As you likely expect, the file ending in .pub is your public key. Now, you need to load this key onto your NUC. I recommend using a tool like .ssh-copy-id or copying the key to a USB flash drive and downloading it onto your NUC. However, if you’re not as security-conscious, you can also email it to yourself and download it onto your NUC through the email client.
    6. Once you have the .pub file copied onto your NUC, open a terminal on the NUC and run $ sudo apt-get install openssh-server to install an ssh server.
    7. Open the .pub file in a text editor and copy the contents of the file. The contents should look like ssh-ed25519 random_string user@Macbook.
    8. In your NUC terminal, run the following command: $ echo <contents_of_your_pub_key> >> ~/.ssh/authorized_keys. This will create a file named authorized_keys and paste in the public key’s contents.
    9. Set the correct permissions for the SSH directory by running: $ chmod -R go= ~/.ssh.
    10. You have now setup an SSH key on your NUC! To connect to it from your Macbook, open a terminal on your Macbook and run $ ssh user@ip-address, where user is the username on your NUC and ip-address is the local IP address of your NUC.
      • Note: You can run ip address in your NUC’s terminal to find the local IP address of your NUC.
    11. After you run the command for the first time, you’ll be prompted with Are you sure you want to continue connecting (yes/no/[fingerprint])?. Enter $ yes.
    12. Your Macbook now is connected to your NUC via SSH. You can work in this terminal, just as you would normally. When you’re done, enter $ exit to close the SSH session.

    Leave a comment