VOOZH about

URL: https://www.tecmint.com/remove-unwanted-services-from-linux/

⇱ How to Disable Unnecessary Services for Better Performance


Skip to content

When you build a server according to your plan and requirements, you want it to run quickly and efficiently, right? But did you know that modern Linux systems, especially those using systemd, often install and run many services by default, even if you don’t need them? These unwanted services consume precious system resources and can even become security risks.

In this article, we’ll walk through how to identify and disable unnecessary services on systemd-based Linux distributions like Fedora, CentOS, Ubuntu, Debian, and others.

TecMint Weekly Newsletter
Get the Learn Linux 7 Days Crash Course free when you join 34,000+ Linux professionals reading every Thursday.
Check your email for a magic link to get started.
Something went wrong. Please try again.

Why Should You Care About Unwanted Services?

When you install Linux, the OS typically enables several services automatically. For example, you might end up with web servers, FTP servers, print servers, or network services running without you asking for them. But if your server doesn’t need those, they’re just wasting CPU, memory, and opening attack surfaces.

Before disabling services, ask yourself:

  • What do I actually need this server to do?
  • Do I want it to run a web server?
  • Do I need FTP or Samba shares?
  • Am I running DNS or database servers?

Only enable the services that support your server’s purpose.

Check Which Services Are Running

With systemd, managing and checking services is easier than ever, here’s how to list the active services on your system.

List all Running Services

To list all active and running services, you can use the following systemctl command.

sudo systemctl list-units --type=service --state=running
👁 List Running Services
List Running Services

Take a close look at the running services. If a service isn’t essential for your server’s purpose, it’s best to disable it.

Check Open Ports and Identify Listening Services

To see which services are actively listening for network connections on your server, use one of the following commands: ss or netstat.

sudo ss -tuln
OR
sudo netstat -tuln
👁 Check Open Ports
Check Open Ports

These commands display all TCP and UDP ports currently open and waiting for connections. For example, if you spot port 21 (used by FTP) open but you don’t actually need FTP, it’s a clear sign you should disable that service to keep your server secure and resource-friendly.

Common Unnecessary Services on systemd Systems

Not every service that runs on your Linux machine is something you actually need. Depending on whether you’re using your system as a desktop, server, or virtual machine, many services might be running in the background – quietly hogging memory, CPU, or even opening security holes.

Common Services You Might Not Need

Here’s a list of frequently running services you can review. If you don’t use what they support, disable them.

Service Description
avahi-daemon Zero-configuration networking (local service discovery).
bluetooth.service Manages Bluetooth — useless on headless servers.
iscsi.service, iscsid.socket, iscsiuio.socket For iSCSI network storage.
lvm2-monitor.service, lvm2-lvmpolld.socket For managing LVM volumes.
mdmonitor.service, raid-check.timer Related to software RAID.
qemu-guest-agent.service Only useful if you’re running inside a QEMU/KVM VM.
nfs-convert.service, nfs-client.target For NFS (networked file systems).
cups.service Printing services — likely useless on a server.
postfix.service Mail server — unnecessary unless you’re sending mail.
sssd.service Connects to domains like LDAP or AD.
hyperv-daemons Only needed inside Hyper-V virtual machines.
apport.service Ubuntu’s error reporting tool.
zeitgeist, telepathy Desktop logging and messaging services — not for servers.

Use the commands below to disable the services listed above:

sudo systemctl disable avahi-daemon
sudo systemctl disable bluetooth
sudo systemctl disable iscsi
sudo systemctl disable iscsid.socket
sudo systemctl disable iscsiuio.socket
sudo systemctl disable lvm2-monitor
sudo systemctl disable lvm2-lvmpolld.socket
sudo systemctl disable mdmonitor
sudo systemctl disable raid-check.timer
sudo systemctl disable qemu-guest-agent
sudo systemctl disable nfs-convert
sudo systemctl disable nfs-client.target
sudo systemctl disable cups
sudo systemctl disable postfix
sudo systemctl disable sssd
sudo systemctl disable hyperv-daemons
sudo systemctl disable apport
sudo systemctl disable zeitgeist
sudo systemctl disable telepathy

Want to stop them immediately too? Just replace disable with stop in each command.

How to Identify and Review Services

Not sure what’s running on your system or what starts up automatically? Here are some easy commands to help you figure that out:

To list all enabled services and set them to start when your system boots.

systemctl list-unit-files --type=service --state=enabled

To see running services that are active right now.

systemctl list-units --type=service

To analyze boot time and see which services slow down boot:

systemd-analyze blame

This will show how much time each service takes during boot. Look for anything that takes several seconds and decide if you really need it.

How to Stop and Disable a Service

If you find something you don’t need, you can stop it and prevent it from starting again:

sudo systemctl stop # Stops the service now
sudo systemctl disable # Prevents it from starting at boot

To prevent a service from being started manually or as a dependency (mask it)

sudo systemctl mask 

If you ever want to bring it back:

sudo systemctl unmask 
Final Thoughts

By disabling unwanted services on your Linux server, you free up resources, improve security, and reduce potential attack vectors. Modern systemd makes managing these services straightforward.

Remember, a lean server is a fast server. Take control of what runs on your system. Keep your server focused on the job it was built for.

If this article helped, share it with someone on your team.
TecMint Weekly Newsletter
Get the Learn Linux 7 Days Crash Course free when you join 34,000+ Linux professionals reading every Thursday.
Check your email for a magic link to get started.
Something went wrong. Please try again.
TecMint has been free for 14 years. Help keep it that way.
Google AI Overviews and tools like ChatGPT have cut into search traffic for independent tech sites like TecMint. Running this site costs over $2,000 every month for hosting, infrastructure, and paying authors to keep the content accurate and tested.

If this article helped you solve a problem, consider buying a coffee. It helps keep TecMint free, supports the authors, and keeps the project going.
☕ Buy Me a Coffee
Ravi Saive
I'm Ravi Saive, an award-winning entrepreneur and founder of several successful 5-figure online businesses, including TecMint.com, GeeksMint.com, UbuntuMint.com, and the premium learning hub Pro.Tecmint.com.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

25 Comments

Leave a Reply
  1. Stopping, disabling and deleting unwanted services is easy. The big problem is knowing which services are unwanted/unneeded. With literally hundreds of services with cryptic, unintuitive names running on a system at any one time, how is one to know which services are essential and which are superfluous?

    Who is the target audience for this article? Sysadmins? They already know which services the want/need running on their systems. This article does nothing for a casual Linux user. It assumes that one already knows what each service does and, therefore, which services can be disabled. Am I expected to Google each and every service to find out if I can stop it?

    Reply
  2. Hi, you say “FTP to transfer files from one host to another host”

    Unclear. Is this client or server? You don’t say. If it’s client, then it’s not “from one host to another”, it’s “connect to a remote FTP server from this machine.” If it’s server, then it’s “accept connections from remote clients.”

    I need FTP client, so I’m afraid to remove this – i don’t know if it’s server or client.

    thanks

    Reply
  3. Hi, you say “In the above output, you notice smbd and nmbd“, but i don’t see smbd and nmbd in the above output.

    That’s confusing.

    Thanks

    Reply
  4. The most useful tutorial I had never seen before !!
    Thank you

    Reply
  5. I was looking for this and somebody from Debian user forums referred me here thanks..

    Reply
  6. Nice work bro. Keep it up.

    Reply
  7. ok well but how to make it permanent block service at reboot etc.. thanks for your help regards

    Reply
    • Paul which service/Application you want to block permanently?

      You may like to uninstall that specific program or write a script to block and add it to run as start-up application so that no unwanted package keeps on utilizing your system resource.

      Reply
    • Thanks @ Minhaj for your feedback.

      Reply
  8. Hi There,

    My Linux network services stops by itself..i don’t know why… when I tried to start by using network service start , it started pinging and working but after an hour it stopped again by itself..what could be the reason?

    Please help…

    Reply
    • Condense log files for the possible reason.

      Reply
  9. hi..sir am new bea for linux ..giv me suggestion to me …how to prepare …for interview…

    Reply
    • Keep Connected, Keep learning @ Santhosh

      Reply
  10. thanks for share! nice article~

    Reply
    • Thanks for your feedback @ mingmings

      Reply
  11. In Red Hat based, systemctl seems a more convenient approach than checkconfig.
    systemctl disable apache

    Reply
  12. Very good tips! :)
    Thanks for share!

    Reply
    • Thanks for the Feedback.
      Welcome.

      Reply
  13. thanks for this. Very helpful article.

    Reply
    • welcome @ Bob Crochelt

      Reply
      • Mr. Kumar, maybe you should recheck your writing in 4th paragraph from bottom. It should be Debian, not Debain. Thank you.

        Reply
        • Sorry, that was a typo, corrected now..

          Reply
  14. There is a much more simple. Install Arch Linux, make it as you want. Nothing enabled by default ;)

    Reply

Got Something to Say? Join the Discussion... Cancel reply

Free Course
Get a free Linux course before you go.
Subscribe to TecMint Weekly and get the Learn Linux 7 Days Crash Course free. Read by 34,000+ Linux professionals every Thursday.
Check your email for a magic link to get started.