Skip to main content

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.
This guide runs on the Java runtime.

Get the project

Download Lavalink.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.
Create an application.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
Lavalink downloads the plugin on its first start. For every other option (other sources, filters, buffers), see the official example file.
Keep address: 0.0.0.0 and don’t replace the port with a fixed value other than 80: Square Cloud delivers your subdomain’s traffic to port 80 of your application.

Set a strong password

Replace the password 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:
See Environment variables for the other ways to manage them.

Configure Square Cloud

Create a squarecloud.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.jar
  • application.yml
  • squarecloud.app
Put the three files in the same folder and compress them into a .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.
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.
Uploading application to Square Cloud
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 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.
App not starting? See the Troubleshooting guide for the most common causes and fixes.

Via CLI

To use this method, your project needs a configuration file named squarecloud.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 squarecloud.ignore lists, and uploads it:
To upload a zip you created yourself, pass it with --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.
App not starting? See the Troubleshooting guide for the most common causes and fixes.

Connect your bot

Lavalink listens on port 80 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):
Since March 2026, Discord only lets bots into voice channels with DAVE, its end-to-end encryption for voice. Lavalink supports it from version 4.2.0, and your bot’s Lavalink client must support it too: otherwise the bot connects to Lavalink but can’t join a voice channel.

Common errors

Connecting with port 80 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.
For more about Lavalink, see the official Lavalink documentation.

Contact us

If you continue facing technical difficulties, our specialized support team is available to assist you. Contact us and we’ll be happy to help you resolve any issue: support quality is a big part of why developers rate Square Cloud 4.9/5 across 402 reviews on Google and Trustpilot.