How to stop a dev server running within an environment?

I started to setup a new cloud agent environment. During the environment setup, it successfully recognised the project structure (using Vite), and started the dev server. However, I had to prompt for a small change in the AGENTS.md, it made the change, but complained, that the default port is already in use (by the previous command). It started a new instance now, so I have two dev servers running and two ports exposed.

I also cannot seem to be able to save my environment at the moment, likely due to an unrelated issue.

Hey, good request. This is currently one of the limitations of Cloud Agents.

There’s no direct terminal access inside the VM, but there are a couple of workarounds:

  1. You can ask the agent via prompt to stop the process, for example: ā€œKill the dev server running on port 5173 before starting a new oneā€. The agent has terminal access and can run kill or lsof -i :5173 and then kill the process.

  2. A more reliable long-term option is to set up .cursor/environment.json for the project, where you can explicitly define the start command. This gives you more control over what runs in the environment. Docs: https://cursor.com/docs/cloud-agent/setup

About not being able to save the environment: there was a known issue with 500 errors when saving, and it was fixed recently. Try saving again, it should work now. If you still get an error, send a screenshot and we’ll take a closer look.

Let me know how it goes.

1 Like