@czynjay
You may start Appium Server side where the code is been executed.
This is the Java code:
private static AppiumDriverLocalService appiumServer;
public static void startAppiumServer(int port) {
if (appiumServer == null) {
appiumServer = AppiumDriverLocalService.buildService(
new AppiumServiceBuilder()
.usingPort(port));
}
appiumServer.start();
}
This code is only for Windows.
You may check this link for options.
BR