Tag Archives: service

Automatically start Tomcat on startup in Ubuntu

Apache Tomcat is not configured with autostart by default in Ubuntu. So, custom init script is required to configure Tomcat for autostart on startup.

Create the init script in /etc/init.d/tomcat8 with the contents as per below.

Init script contents:

Note: Please change {tomcat_root} with your Tomcat installation folder path.

Change its permissions and add the correct symlinks automatically:

And from now on it will be automatically started and shut down upon entering the appropriate run levels.

It could be also controlled with justservice tomcat8 <stop|start|restart> like Apache control commands.

Using above process any server script can be created and configured to start on startup.