![Galactic Logo](https://s3.galaxybot.app/media/galactic/standaloneBanner.png?v=3) # Getting Started: Standalone Instance This example shows how to launch Galactic in standalone mode, running multiple clusters and shards on a single machine for efficient scaling. ## Step 1: Setup Your Entrypoint Create an `index.ts` file to launch the standalone instance. ```ts filename="index.ts" import {StandaloneInstance} from "galactic.ts"; // Create a standalone instance running 2 clusters with 2 shards each const machine = new StandaloneInstance( `${__dirname}/bot.js`, // Path to your bot entry script 2, // Number of clusters 2, // Shards per cluster process.env.TEST_SA_BOT_TOKEN!, // Your Discord bot token [] // Intents ); machine.start(); // Start the standalone instance ``` - The first argument is the path to your bot entry script. - The second argument sets the number of clusters, and the third sets shards per cluster. - Pass your Discord bot token, and optionally extra arguments. *** ## Step 2: Implement Your Bot Logic In your `bot.ts`, initialize the bot and handle clustering integration. [Create bot.ts](Cluster.md) Your standalone instance will start multiple clusters and shards according to your configuration. On each restart, Galactic automatically balances the workload. *** ## Next Steps - Explore [galactic bridge](./Bridge.md) for distributed setups *** If you have questions or want to contribute, visit [GitHub discussions or the issue tracker](https://github.com/GalaxyBotTeam/galactic.ts).