Introduction
To develop and host a Lavalink server on Square Cloud, it’s essential to follow a structured sequence of configurations and prerequisites. This technical guide will cover the entire process, from initial setup to production deployment.Prerequisites
- Square Cloud Account: Register through the signup page using your email.
- Active plan: Ensures dedicated resources and optimized performance for your application. Check our available plans and choose the most suitable for your needs.
Get the project
DownloadLavalink.jar from the official releases page. This guide uses Lavalink v4: pick the latest 4.x release (4.2.0 or newer), and make sure your bot uses a Lavalink client built for v4 that supports DAVE (see Connect your bot).
We already have everything ready for deploy in our lavalink-web releases, with the YouTube plugin set up. Download the
project.zip and upload it: during the Lavalink deploy, replace the placeholder value of LAVALINK_SERVER_PASSWORD in the environment variables with a long random password.Configure Lavalink
Create anapplication.yml file next to Lavalink.jar. The minimal configuration below listens on the port in the PORT environment variable (Square Cloud sets it to 80) and plays YouTube through the official youtube-source plugin, since the YouTube source built into Lavalink is deprecated:
application.yml
Set a strong password
Replace thepassword value with a strong, random password of at least 32 characters. To keep it out of your files, set it in the LAVALINK_SERVER_PASSWORD environment variable instead: Lavalink gives environment variables precedence over application.yml. Add the variable in the upload form’s Advanced configuration or on your application’s Environment Variables page in the dashboard, or from the CLI:
Configure Square Cloud
Create asquarecloud.app file next to Lavalink.jar. The SUBDOMAIN field publishes your server at https://<subdomain>.squareweb.app:
squarecloud.app
MAIN=Lavalink.jar makes Square Cloud start the server with java -jar Lavalink.jar, MEMORY is its RAM in MB, and AUTORESTART=true starts it again if it crashes (see how auto restart works).
What goes in the ZIP
Lavalink.jarapplication.ymlsquarecloud.app
.zip file to upload from the dashboard.
Deploy and verify
Via dashboard
1
Access the Upload Page
Access the upload page and upload your project zip file.
2
Configure Your Environment
After uploading your zip, you will need to configure the name, main file or runtime environment and other settings for your project.
If you are uploading a web project, make sure to select “Web Publication” and set a subdomain to your project.
If you are uploading a web project, make sure to select “Web Publication” and set a subdomain to your project.
3
Deploy Your Project
Finally, click on the “Deploy” button to host your project on Square Cloud.
After deployment, you can monitor your project’s status and logs from the dashboard.
After deployment, you can monitor your project’s status and logs from the dashboard.

4
Confirm Your App Is Live
Your first deploy usually takes less than a minute. In the dashboard, wait for your application status to show as running and check the logs for any startup errors.
If you deployed a website or API, open
If you deployed a website or API, open
https://<your-subdomain>.squareweb.app in your browser: you should see your application responding. If you deployed a bot, send it a command to confirm it is online.
Via CLI
To use this method, your project needs a configuration file namedsquarecloud.app at its root. It tells Square Cloud how to run your application.
Configuration file guide
Learn how to create the
squarecloud.app configuration file that defines your application’s environment.1
Install the CLI
Install the Square Cloud CLI. If you already have it, run the same command to update it:
2
Log In
Run the command below. It opens your browser: approve the login there and the CLI is ready. There is no API key to copy. For scripts and CI, see CLI authentication.
3
Upload Your Project
From your project folder, run the command below. The CLI zips the current folder, leaving out what To upload a zip you created yourself, pass it with
squarecloud.ignore lists, and uploads it:--file:4
Confirm Your App Is Live
Your first deploy usually takes less than a minute. Check your application status and logs directly from the terminal:If you deployed a website or API, open
https://<your-subdomain>.squareweb.app in your browser: you should see your application responding. If you deployed a bot, send it a command to confirm it is online.
Connect your bot
Lavalink listens on port80 inside Square Cloud, but your bot connects through the public edge, which serves HTTPS on port 443. Configure the node in your Lavalink client like this (field names vary between libraries):
Common errors
The bot can’t connect to Lavalink
Connecting with port80 or secure: false fails: use port 443 and secure: true, as shown in Connect your bot. If the connection closes with code 1006, see Lavalink connection closed with code 1006.
Next steps
Discord bot
Host the music bot that connects to your Lavalink server.
Discord bot errors
Fix invalid tokens, missing intents and Lavalink connection errors.
Java runtime
How Square Cloud runs Java applications.

