Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I was wondering how can I disable the apache2 server from running upon boot up? I can't seem to find an option which disables it to auto start when I turn on the machine.

share|improve this question
Perhaps someone can be more specific, but I can point you in the right direction... in /etc, there are directories for rc*.d, which contain all the start/stop scripts, called, I think, init scripts. You'll see links to scripts that are in /etc/init.d, and starting with either "k" or "s", for "kill" or "start", and a number which is the ordering. –  Marty Fried Aug 1 '12 at 2:27
Yes, I knew about the /etc/rcX.d directories, but I searched for it to find out about some nicer tool, than just manually renaming files (life is too short). update-rc.d has filled this void. –  Tomasz Gandor Sep 26 '14 at 8:53

3 Answers 3

up vote 36 down vote accepted

Under the folder /etc/init.d/ you will find all the init scripts for different boot up services. like apache2 , networking etc.

depending on which runlevel the computer starts in, different services are started. so from the /etc/init.d/ folder each "service" is linked to one / many / no run level folders named from rc0.d to rc6.d

To keep things simple there is a tool for removing / adding these links, hence removing or adding scripts to and from start up.

to remove apache2 simply type:

sudo update-rc.d -f  apache2 remove

and all run level folders that have apache2 linked to them will the apache2 service removed

share|improve this answer
chkconfig may also help - " chkconfig {service_name} off " –  MCR Aug 1 '12 at 7:10
thanks for the answer! –  niccolo m. Aug 1 '12 at 7:22

you could simply disable it by:

sudo update-rc.d apache2 disable

and then if you would like to enable it again:

sudo update-rc.d apache2 enable

depending on the project i am working on, it is handy to have the service conveniently available, if i wish to re-enable it.

share|improve this answer
enable gave me an error like runlevel arguments (none) do not match LSB Default-Start values, but sudo update-rc.d apache2 defaults appears to have re-enabled it successfully. –  here Jan 13 '14 at 3:58
+1, this should be the accepted answer. –  jutky Jan 19 '14 at 11:34
@here sudo update-rc.d apache2 enable played as expected for me –  George Pligor Feb 9 '14 at 15:12
On Ubuntu Trusty it tells me "The disable|enable API is not stable and might change in the future." –  Tanner Jun 10 '14 at 0:31
Doesn't work - error: no runlevel symlinks to modify, aborting!. However, apache2 is running and autostarts. –  Daniel Dec 14 '14 at 11:05

This GUI is very functional and easy: http://www.marzocca.net/linux/bum.html

share|improve this answer
Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  fossfreedom Dec 17 '13 at 21:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.