Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

julesbroeks's avatar

How can i get the IP adress new digitalocean droplet after creating it from laravel ?

Hi guys !,

I'm fairly new to laravel and i want to make a application that can make a digital ocean server, than get the ip adress of that newly created server.

Creating the droplet is succesfull, but the setup in digitalocean will take some time and i don't want the application to wait for it to be finished, but i want it to get the ip adress once the droplet is set up in the background and do some stuff with that new ip adress ( store that ip for example )

Thanks in advance.

0 likes
2 replies
bobbybouwmann's avatar

I believe when you create a new droplet through the API you get a droplet id. You can use this id to fetch the information from a box.

See: https://developers.digitalocean.com/documentation/v2/#create-a-new-droplet

After that you can retrieve the droplet information using the id you get before. It will probably give some error message if the droplet isn't ready or not created yet, so you can catch that error and wait a few more minutes

See: https://developers.digitalocean.com/documentation/v2/#retrieve-an-existing-droplet-by-id

ejdelmonico's avatar

As @bobbybouwmann referenced...there are several ways to return the droplet IP. The docs give a good example. Also, there are many others online with code included.

1 like

Please or to participate in this conversation.