Mac Run PlantUML Server on Login

To run a PlantUML server on login for your Mac, you can follow these steps using Automator. This will ensure that the PlantUML server starts automatically every time you log in.

Step 1: Install PlantUML

First, make sure you have PlantUML installed on your Mac using Homebrew. You’ve already mentioned the command:

1
brew install plant-uml

Step 2: Create an Automator App

  1. Open “Automator” on your Mac. You can find it by searching for it in Spotlight or in the Applications folder.

  2. When Automator opens, it will ask you to choose a type for your document. Select “Application” and click “Choose.”

  3. In the left-hand Actions pane, search for “Run Shell Script” and drag it to the right-hand workflow pane.

  4. In the “Run Shell Script” action, set “Shell” to “/bin/bash” (or “/bin/zsh” if you use Zsh), and “Pass input” to “as arguments.”

  5. In the script box, add the following command to start the PlantUML server with nohup and send its output to /dev/null:

1
nohup /usr/local/bin/plantuml -picoweb:9191 > /dev/null 2>&1 &
  1. Save your Automator workflow as an application by clicking “File” > “Save” and giving it a name like “PlantUMLServer.”

Step 3: Add Automator App to Startup Apps

  1. Open “System Preferences” on your Mac.

  2. Click on “Users & Groups.”

  3. In the left-hand sidebar, select your user account.

  4. Click the “Login Items” tab on the right-hand side.

  5. Click the “+” button below the list of login items.

  6. Navigate to where you saved the “PlantUMLServer” Automator application and select it.

  7. Click the “Add” button to add it to the list of login items.

Now, every time you log in to your Mac, the PlantUML server should automatically start and run in the background.

Please note that the paths and file names mentioned here are based on the information you provided. Make sure they match your system configuration. Additionally, ensure that you have the necessary permissions to run the PlantUML server on port 9191 if it requires elevated privileges.

0%