How can I stop the MathWorks Service Host from running on startup?
Show older comments
How can I stop the MathWorks Service Host from running on startup?
Accepted Answer
More Answers (3)
Mike VanHorn
on 1 Aug 2024
Edited: Mike VanHorn
on 1 Aug 2024
1 vote
I tried removing $HOME/.MathWorks/ServiceHost/wilbur26/v2024.7.0.6/bin/glnxa64/MathWorksServiceHost, and while MATLAB start up was then slow, it did start up, and the licensing was fine. So MathWorksServiceHost seems to be NOT "essential for MATLAB licensing and MATLAB startup". I'm thinking it must only be related the MATLAB Connector.
However, there does, indeed, seem to be no way to disable it, and rather only work around it's slowness.
1 Comment
Frantisek Brazdik
on 11 Dec 2025
tried the same, but Matlab during its startup reinstalls the MSH again.
Dimitrios
on 2 Sep 2024
0 votes
Hi Matthew,
In order to disable MathWorks Service Host from starting at Operating System login, you can:
Linux: Delete this file: ~/.config/autostart/mathworks-service-host.desktop
macOS: Delete this file: ~/Library/LaunchAgents/com.mathworks.mathworksservicehost.agent.plist
If these files are deleted, MathWorks Service Host will honour this choice and will not re-create them. However modifying the files, as suggested in other answers, will not work for very long, as they will be updated when MathWorks Service Host is updated.
Please note that MathWorks Service Host will still run when MATLAB is started, and that MathWorks Service Host is required for the correct functioning of MATLAB R2024a and later.
10 Comments
Mike VanHorn
on 4 Sep 2024
As I already posted, "MathWorks Service Host is required for the correct functioning of MATLAB R2024a and later" seems to be false, as I was able to disable it entirely and MATLAB still seemed to work just fine. If you could please explain exactly what MathWorks Service Host does, perhaps we would better understand the need for it. From the outside, all it seem to do is slow down the startup of MATLAB, which is pretty slow to start with.
Also, if the modifications I have made to certain files get overwritten when MATLAB is updated, there will be a HUGE explosion of extremely pissed of systems administrators. The second an application starts overwriting user files not associated with the application and housed on an entirely different server, it becomes a security issue and the application goes away very quickly, no matter the precieved "need".
Dimitrios
on 4 Sep 2024
Hi Mike,
You are absolutely right, lots of MATLAB functionality will not be impacted by the absence of MathWorks Service Host, but disabling it will cause performance and/or functional issues for many users. MathWorks Service Host, although a separate process, is part of MATLAB, so disabling it is something similar to deleting files from the installation of a program, it may work some times but there is a high possibility that you may break something.
Regarding the MATLAB startup time, if MathWorks Service Host is already running it should not slow down MATLAB.
Thank you for the feedback regarding the modification of the autostart file. Since these files are owned / created by MathWorks Service Host, we thought that it is reasonable to update them when MathWorks Service Host is updated. If the files are deleted, we will honour that and not recreate them. Deleting the files is therefore the recommended solution to opt-out, rather than modifying them, which will only work temporarily.
eng3
on 24 Mar 2025
Exactly what "performance and/or functional issues" will disabling MathWorks Service Host cause?
Are they all related to web services. Matlab is completely unable to access the internet on our network due to other flaws. If that is it, then it should be safe but if there is something else, I'd like to know
Bennet
on 13 May 2025
This suggests that Matlab R2024a and later are inappropriate for use on shared computers, such as lab computers, clusters, and remote login machines, and that anyone who administers machines used by multiple people should install Matlab R2023b and not any subsequent versions.
Conor Burgess
on 13 May 2025
Edited: Conor Burgess
on 13 May 2025
@Bennet if you are running into issues with MathWorks Service Host in any of the cases you mention, please contact support.
Bennet
on 13 May 2025
The document you cite does not address the issue of the persistent daemons still running, nor how to prevent them from starting in the first place. MathWorks has chosen to write software for personal computers. It's current behavior is simply inappropriate for shared environments with restrictions on what should be run by users. In our case, the Matlab installation is installed centrally, users do not have permission to change it, automatic updates are neither desired nor a good idea for managed installations, and licensing is via a remote license server, and we do NOT want to enable Matlab Drive on these systems.
In short, we think it sad that these are not optional. Since you've decided they are not, we will stop updating Matlab at the last version prior to their introduction and declare Matlab 'deprecated' software for this particular use.
You suggest contacting support, however, I suspect they will say the same things that have been said and will not have instructions for disabling MathWorks Service Host entirely. MathWorks support has shown many times that most of its support personnel are quite good at helping individuals on their personal computers and that they do not understand well the contraints, uses, and desires of those of us who install for many people on shared machines.
You made your choice, and we are making ours. At this point, I think we agree to disagree. If at some point MathWorks does, indeed, make installing MathWorks Service Host an optional feature, I'd be happy to give it another try. Until then, R2023b is what we'll use.
Conor Burgess
on 13 May 2025
Thank you for your feedback. We have various options for customers for whom the default MathWorks Service Host workflow is not appropriate, and support can help us to understand your requirements and which of those options is most appropriate. Alternatively, if we need to work on a different option to support your requirements, we can capture that too. If you don't contact support, none of that is possible, but that is of course your choice!
Bennet
on 13 May 2025
Thanks for the additional information, Conor. We'll open a support ticket.
M. C Ertem
on 23 Dec 2025
So, MW wants every single person who does not want this MWSH crap wasting our resources to individually call support to ask how to disable it???
HOW ABOUT MAKING A SUPPORT PAGE SHOWING HOW TO DO THIS???
I will do a cron job that calls KillMWSH.sh containing
killall MathWorksServiceHost
rm -rf ~/.MathWorks/ServiceHost
Conor Burgess
on 23 Dec 2025
If you are seeing problematic resource usage, please do contact support. MathWorks Service Host resource usage should be minimal and should not have a noticeable impact on your machine's performance.
Michael Jablecki
on 13 Nov 2025
0 votes
Also note that the process which spawns multiprocessing processes no longer inherits priority from the first Matlab process. Before: renice the main process and multiprocessing respects that niceness level assigned to the main Matlab process. Now - nope. This is another concrete example of the Matlab disrespecting the need to use more than just Matlab on Linux compute nodes for those without the luxury of fully-dedicated compute machines.
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!