Did You Know? You can Install Payara Server as a Service to Automatically Start on Boot

Uncategorized
No Image

Did You Know…?

You can Install Payara Server as a Service to Automatically Start on Boot 

 

In the world of pre-configured Docker & Kubernetes containers and Microservices, it’s easy to forget that not everybody is rushing to jump on the bandwagon quite yet and are still using the more traditional application server setup. With that in mind,  many people like it when their servers start themselves up automatically on boot so that you don’t have to manually log onto each server and start the instances yourself. Now while you can get by using a script and a task scheduler like cron or Task Scheduler (Windows wins on the more obvious naming front here!), you can actually install Payara Server as a service like Apache HTTP Server or SSH so you can control it with your OS-native services manager. 

 

The asadmin command to do this is: 

create-service [domain-or-instance-name]

 

 

If you don’t provide a domain or instance name, it will default to using domain1. 

 

The command takes several additional options for configuring your service, and as alluded to in the previous sentence, you’re not restricted to installing only the DAS instance as a service. You can specify an instance name with a node name in which it resides to install it as a service too.

 

As with any asadmin command, you can run it with the –help option to get information about the available options. Since you’re here though, I’ll briefly describe each of the options: 

  • serviceuser – A Linux-only option, this allows you to specify which user should be running the service (handy if you want to create a protected user). 
  • domaindir – The directory that contains the domain information (handy if you keep your domains separate from your installations). 
  • nodedir & –node – The directory and node name that the instance / DAS belongs to. 
  • –name – A Windows-only option, this allows you to specify the name of the service. For Linux, the service name defaults to the domain or instance name. 
  • serviceproperties  Additional configuration properties for the service, such as (on Windows only) setting the display name of the service. 
  • –dry-run – As the name suggests, runs your command without actually committing anything to help you flag up any errors or issues. 
  • –force – Self-explanatory, forces the creation of the service even if validation checks fail 

Hope this helps! 

 

 

Comments (3)

Post a comment

Your email address will not be published. Required fields are marked *

Payara needs the contact information you provide to us to contact you about our products and services. You may unsubscribe from these communications at any time. For information on how to unsubscribe, as well as our privacy practices and commitment to protecting your privacy, please review our Legal & Privacy Policy.

  1. Kevin Penrose

    Tried using this functionality to start Payara on reboot on a linux system and got the following error hundreds of times: Starting GlassFish_lamtec-dev depends on plymouth and therefore on system facility ‘$all’ which can not be true!
    Suggestions??

    1. Andrew Pielage

      Hi!

      That’s not an error I’ve ever seen before personally, but it looks like it’s indicating that there’s a dependency conflict in your boot services (init.d or equivalent).

      I’d recommend raising this on our forum where we and others can better help you, as my only suggestion with what you’ve given me would be to scour the start-up service logs for where the conflict may be coming from.

      Thanks,
      Andrew

  2. Cedric Pemberton

    Hi,

    Almost what i was looking for well it is what I was looking for but would be more help full if some example were provided.

    Thanks

Related Posts

4 minutes
Uncategorized

Leading the Way: Payara Platform Community 7 Beta Now Fully Jakarta EE 11 Certified

We’re excited to announce that Payara Platform Community 7 Beta application server is now fully certified as Jakarta EE 11 […]

Understanding the Security Issues of Aging Middleware 6 minutes
Community

Boost Developer Productivity with Payara Server Maven Plugin + AI Agent

Managing Payara Server Just Got Smarter  Imagine managing your Jakarta EE applications not just with Maven goals, but by […]

Blue background with coral and fish. Left text: 'MONTHLY CATCH'. Right: laptop screen with tech tabs and Payara Community logo. 4 minutes
Community

The Payara Monthly Catch – August 2025

Welcome aboard the August 2025 issue of The Payara Monthly Catch! With summer in full swing, things may have felt […]