How to set studio hostname via API?
I understand how frustrating that is! When sanity deploy stops after you choose a hostname and press Enter, this is usually related to a few common issues. Let me walk you through the most likely causes and solutions:
Authentication Issues
The most common reason for the deployment hanging after hostname selection is authentication problems. The CLI might be failing silently because it can't verify your credentials. Try running:
sanity loginThis will refresh your authentication token. Then try sanity deploy again. If you're deploying from a CI/CD environment, make sure you have a valid SANITY_AUTH_TOKEN environment variable set, as mentioned in the Azure DevOps deployment guide.
Outdated CLI Version
An outdated CLI version can cause unexpected behavior during deployment. Update to the latest version:
npm install -g @sanity/cli@latest
# or if using the project locally
npm install @sanity/cli@latestAfter updating, try deploying again.
Terminal/Input Handling Issues
Sometimes terminal input buffering or encoding issues can cause the Enter key to not register properly:
- Try using a different terminal (if on Windows, try PowerShell vs CMD vs Git Bash)
- Try pressing Enter multiple times
- Check if your terminal is actually waiting for input (sometimes there are additional prompts that aren't visible)
Network or Firewall Problems
The deployment might be hanging on network requests after you press Enter. Check if:
- Your firewall or corporate proxy is blocking connections to Sanity's deployment servers
- You have a stable internet connection
- Your DNS is resolving correctly
Try running the deploy command with verbose output to see if there are network errors:
sanity deploy --verboseBuild Issues
Sometimes the Studio build itself fails silently. Before deploying, try building locally first:
sanity buildThis will show you any build errors that might be causing the deployment to fail.
Check Your Project Configuration
Make sure your sanity.config.ts (or .js) file is properly configured with your project ID and dataset. Missing or incorrect configuration can cause deployment issues.
Alternative Troubleshooting Steps
If none of the above work:
- Check the Sanity management console: Go to sanity.io/manage and verify your project exists and you have proper permissions
- Try deploying to a different hostname: Sometimes specific hostnames might have conflicts
- Clear your CLI cache: Delete the
.sanityfolder in your project and try again
Get Help
If you're still stuck, the Sanity Slack community is very active and responsive to deployment issues. You can also check GitHub discussions for similar issues. When asking for help, include:
- Your CLI version (
sanity --version) - Your Node.js version (
node --version) - Any error messages from
sanity deploy --verbose - Your operating system
The sanity deploy command builds and deploys your Studio to Sanity's hosted environment at [your-hostname].sanity.studio, and as explained in the deployment documentation, it also deploys your schema for use with other Sanity platform features. When it works correctly, you should see build progress and then deployment confirmation.
Show original thread7 replies
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.