FreeKB - Samba (File Server) Install Samba on Linux (smb)
Samba (File Server) - Install Samba on Linux (smb)

Your Linux distributions package manager can be used to install Samba.

  • apt-get on Debian distributions
  • yum on Red Hat 7 distributions (CentOS, Fedora, Red Hat)
  • dnf on Red Hat 8 distributions (CentOS, Fedora, Red Hat)

In this example, dnf is used to install Samba.

dnf install samba
dnf install cifs-utils


Allow the samba, http and https services in iptables or firewalld.

firewall-cmd --add-service=samba --permanent
firewall-cmd --add-service=http --permanent
firewall-cmd --add-service=https --permanent
firewall-cmd --reload


The ps command can be used to determine if your system is using init or systemd. If PID 1 is init, then you will use the service command. If PID 1 is systemd, then you will use the systemctl command.

If your system is using systemd, use the systemctl command to start and enable Samba.

systemctl enable smb
systemctl start smb
systemctl status smb


If your system is using init, use the chkconfig and service commands to start and enable Samba.

chkconfig enable on
service start smb
service status smb


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 695f3 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |