• WordPress
  • cPanel
  • Softaculous
  • KVM Virtualization
  • Vmware Virtualization
  • Proxmox
Saturday, June 14, 2025
LinuxBoost
  • Home
  • Almalinux
  • CentOS
  • Debian
  • Fedora
  • Ubuntu
  • Red Hat Enterprise Linux
  • Rocky Linux
  • OpenSUSE
  • Arch Linux
  • Oracle Linux
No Result
View All Result
LinuxBoost
  • Home
  • Almalinux
  • CentOS
  • Debian
  • Fedora
  • Ubuntu
  • Red Hat Enterprise Linux
  • Rocky Linux
  • OpenSUSE
  • Arch Linux
  • Oracle Linux
LinuxBoost
  • Home
  • Almalinux
  • CentOS
  • Debian
  • Fedora
  • Ubuntu
  • Red Hat Enterprise Linux
  • Rocky Linux
  • OpenSUSE
  • Arch Linux
  • Oracle Linux

How to set up a file server on Ubuntu using Samba or NFS

in Linux OS, Ubuntu

A file server is a computer system that provides a central location for storing and sharing files across a network. It can be useful in both personal and business settings, allowing for easy access and collaboration among users. In this blog, we’ll explore two popular ways to set up a file server on Ubuntu using either Samba or NFS.

What is Samba?

Samba is a popular open-source software suite that provides file and print services for Windows clients. It uses the SMB/CIFS protocol to provide seamless interoperability between Linux/Unix servers and Windows-based clients.

Setting up Samba

Here’s how you can set up Samba on Ubuntu:

  1. Install Samba

You can install Samba on Ubuntu using the following command:

sudo apt-get install samba
  1. Configure Samba

After installing Samba, you need to create a directory that will be shared. You can create a new directory or use an existing one.

sudo mkdir /home/samba/share

Next, you need to edit the Samba configuration file to define the share. Open the configuration file with the following command:

sudo nano /etc/samba/smb.conf

Add the following lines at the end of the file:

[share]
path = /home/samba/share
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
read only = no

This configuration defines a share called “share” that will allow all users in the “users” group to access it. It also sets the appropriate permissions for creating and accessing files within the share.

  1. Restart Samba

After making changes to the Samba configuration file, you need to restart the Samba service:

sudo systemctl restart smbd
  1. Set up user accounts

To access the Samba share, users must have an account on the Ubuntu system. You can create a new user with the following command:

sudo useradd username

Replace “username” with the actual username you want to create. You can also set a password for the user with the following command:

sudo passwd username
  1. Access the Samba share

To access the Samba share from a Windows machine, open File Explorer and enter the Ubuntu server’s IP address in the address bar (e.g. \192.168.1.100). You should see the “share” folder listed, and you can access it by double-clicking on it and entering your Ubuntu username and password when prompted.

What is NFS?

NFS (Network File System) is a popular protocol for sharing files across a network. It was developed by Sun Microsystems in the 1980s and has since become a standard protocol for file sharing on Unix/Linux systems.

Setting up NFS

Here’s how you can set up NFS on Ubuntu:

  1. Install NFS

You can install NFS on Ubuntu using the following command:

sudo apt-get install nfs-kernel-server
  1. Configure NFS

After installing NFS, you need to define the directory that will be shared. You can create a new directory or use an existing one.

sudo mkdir /home/nfs/share

Next, you need to edit the exports file to define the share. Open the exports file with the following command:

sudo nano /etc/exports

Add the following line at the end of the file:

/home/nfs/share  *(rw,sync,no_subtree_check)

This configuration defines a share called “share” that will allow all hosts to access it with read/write permissions.

  1. Restart NFS

After making changes to the exports

In conclusion, setting up a file server on Ubuntu using either Samba or NFS is a great way to provide a centralized location for storing and sharing files across a network. Samba provides seamless interoperability between Linux/Unix servers and Windows-based clients, while NFS is a standard protocol for file sharing on Unix/Linux systems. By following the steps outlined in this blog, you can easily set up a file server on Ubuntu using either Samba or NFS and enjoy the benefits of easy access and collaboration among users.

ShareTweet
Previous Post

How to configure and manage system services in Ubuntu with systemd

Next Post

How to configure and use SSH for secure remote access to Ubuntu

Related Posts

How to Install Tomcat on Rocky Linux

How to Install Apache Tomcat on Rocky Linux

How to Set up NTP Server on Rocky Linux

How to Set up NTP Server on Rocky Linux

How to Install Bacula Backup Server on Rocky Linux

How to Install Bacula Backup Server on Rocky Linux

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Golden Host VPS
  • Privacy Policy
  • Terms and Conditions
  • About Us
  • Contact Us

Copyright © 2023 linuxboost.com All Rights Reserved.

  • Privacy Policy
  • Terms and Conditions
  • About Us
  • Contact Us

Copyright © 2023 linuxboost.com All Rights Reserved.