If you use a Home Assistant server on a Raspberry Pi or old PC for home automation, you can also use the leftover space in the SD card or SSD for network-attached storage (NAS). You may also connect an external hard drive or SSD to your Raspberry Pi or old laptop running the supervised Home Assistant server and use that storage for the NAS. Here’s how to do it.

Prerequisites for a Home Assistant NAS Server

There are a couple of prerequisites for using Home Assistant for an NAS server:

  • You must have a supervised Home Assistant server running on a Raspberry Pi 3 or 4. Raspberry 4 is preferred as it offers Gigabit LAN and USB 3.0 ports, allowing faster data transmission.
  • An external storage device (optional), such as an external SSD or a hard drive with a power supply. Although you can connect an external hard drive to the Raspberry Pi, it is recommended that you use one that comes with a separate power supply and does not depend on the power coming through the USB port.

If you are using a Raspberry Pi 4, you can migrate the Home Assistant server from your SD card to an SSD to get more storage with much faster I/O performance. Make sure the SSD is large enough to be used as network storage (>=250GB). You must enable USB boot mode to boot Raspberry Pi via SSD. Once you have configured the SSD, follow the instructions below to set up a Samba NAS on the Home Assistant server.

If you are running the supervised Home Assistant installation on an Intel or AMD-based old computer or laptop, you cannot use the Samba NAS add-on as it’s only compatible with HASS OS. However, you can install the Samba add-on to build the NAS, assuming the machine has an SSD or hard drive with at least 250GB of storage. The only downside is that you can only access internal storage and cannot mount external storage with this add-on.

Install and Set Up Samba NAS Add-On in Home Assistant

On your Home Assistant, log in as the administrator and then follow these steps to install and configure the Samba NAS add-on.

  1. Go to Settings > Add-Ons and click the three dots.
  2. Choose Repository and then paste this URL: https://github.com/dianlight/hassio-addons.
  3. Click OK and then click Install Add-On.
    add repository to home assistant add on list
  4. Search for and click on Samba NAS.
  5. Click Install.
  6. After the installation, click the Configuration tab.
  7. Enter the following details,
    • workgroup name
    • username
    • password
    • Enable/disable MQTT. If you enable this, you need to enter additional MQTT details. This will create an entity that you can add in the Home Assistant dashboard to view leftover storage in the connected drives.
  8. Click Save.
    samba nas home assistant configuration
  9. Alternatively, you can click on the three dots at the top, choose Edit in YAML, paste the following code, and click Save. Make sure to change the workgroup, username, password, and allow_hosts IP.
            workgroup: WORKGROUP
    username: homeassistant
    password: "1234"
    allow_hosts:
      - 10.0.0.0/8
      - 172.16.0.0/12
      - 192.168.0.0/16
      - fe80::/10
    moredisks:
      - <PARTITION LABEL>
    available_disks_log: false
    medialibrary:
      enable: false
      ssh_private_key: <YOU SUPER SECRET PRIVATE KEY>
    veto_files:
      - ._*
      - .DS_Store
      - Thumbs.db
      - icon?
      - .Trashes
    compatibility_mode: false
    wsdd2: false
    autodiscovery: {}
    other_users: {}
    acl: []
    interfaces: []
  10. Go to the Info tab and click Start.

Access NAS Storage

You can now access the Home Assistant NAS storage over the network on your Windows, macOS, Linux, iOS, or Android device.

Windows

To access the NAS from a Windows PC:

  1. Press Windows + R, type the IP address of your Home Assistant server, and click OK.
  2. Enter the username and password and click OK.
  3. This will open a File Explorer window displaying the folders in the drive.
    accessing samba share location on windows pc
  4. If you have not connected external storage, you will see folders in the internal storage.

macOS

To access the NAS from a macOS machine:

  1. Open the Finder app and click on Go > Connect to Server… Alternatively, you can press the Cmd + K keyboard shortcut to open the Connect to Server dialog box.
  2. Enter the IP address of the Home Assistant (HA) server with the smb:// prefix and click the + icon to add.
  3. Select the added HA NAS IP and click Connect.
  4. Choose Registered User and enter the username and password.
  5. Click Connect.

Linux (Ubuntu)

To access the NAS from a Linux (Ubuntu) PC:

  1. Open the file manager in the Linux OS and click on Connect to Server under Network.
  2. Enter the IP with the smb:// prefix and click OK.
  3. Enter the username and password. Click Connect.
  4. This will open the NAS storage. You now access and upload/download files to/from the NAS locations.

Android

To access the NAS from a Samsung Android device:

  1. Open the My Files app and tap on Network Storage.
  2. Tap on the + sign in the top right corner.
  3. Select Network Drive (SMB) for NAS.
  4. Click Add Manually.
  5. Enter the IP address of your Home Assistant server with port: 445.
  6. Enter the username, password, and display name.
  7. After you click the Add button and if the input information is correct, you should see the folder and have access to files from the Home Assistant NAS.

On stock Android OS and other Android smartphones, you can use the default file manager app if it supports network storage. Otherwise, you can install and use the My Files app from Samsung and follow the instructions above to access the NAS on your Android smartphone.

iOS

To access the NAS from an iPhone or iPad:

  1. Open the Files app.
  2. Tap on the three dots at the top right and select Connect to Server.
  3. Type the IP address of your Home Assistant server and tap Connect.
  4. Enter the username and password to connect and access the folders.
  5. Once configured, you will see the network storage in the Files app’s dashboard. Tap on it to connect and access files from your HA NAS anytime.

If you want to connect external storage to your Home Assistant and use it as NAS storage, make sure it’s formatted as EXT3/EXT4.

Use Leftover Storage Effectively

The Samba NAS is a modified version of the original Samba add-on for HA that you can install on your supervised Home Assistant server running on Home Assistant OS and use the leftover storage on the server for storing data over the local network. With Samba NAS, you can add or mount external storage devices, such as a USB drive or external hard disk or SSD, and use the volumes for data storage.