Sushil Sharma
Sushil Sharma

Reputation: 2361

Start Jenkins local server on Mac

I am trying to integrate CI/CD using Jenkins. I have properly set Jenkins up on my mac by installing Java JDK and all. The localhost url was also accessible. I was able to manage plugins using http://localhost:8081 url.

But I accidentally closed the terminal window and the Jenkins was stopped. The url stopped working. It now shows error

This site can’t be reached

localhost refused to connect.

I tried to run the Jenkins from terminal using this command

sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist

also this command:

sudo launchctl start /Library/LaunchDaemons/org.jenkins-ci.plist

The terminal asks for password, but the url still does not work. I even tried unloading the Jenkins using this command:

sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist

Then again loading and starting command. But its not working.

Any help would be appreciated. Thanks

Upvotes: 1

Views: 6944

Answers (1)

Sushil Sharma
Sushil Sharma

Reputation: 2361

This is how I solved the above problem

Go to Jenkins directory

/Users/me/Downloads/Jenkins

Then run Jenkins on any port (default 8080 or any other)

java -jar jenkins.war --httpPort=8081

And the localhost is working now.

This was a stupid situation.

Upvotes: 2

Related Questions