# How to Host a StarMade Server for Friends or a Faction

Set up a StarMade dedicated server: install the files, start it with -server -port:4242, edit server.cfg, open TCP 4242 and get friends connected.

Updated 2026-10-07. https://gamezservers.com/guides/how-to-host-a-starmade-server

To host a StarMade server, install StarMade on the machine that will run it, start `StarMade.jar` with the `-server` flag and a port (4242 is the default), let it generate `server.cfg` and the universe, then stop it, edit the settings and start it again. Open TCP port 4242 in your firewall and router so friends can type your address into **Online Play**. A small group of builders needs about 4 GB of RAM for the server, more once factions start parking big fleets.

StarMade's server is a Java program, so it runs the same on Windows and Linux. The steps below assume a fresh machine or a spare folder on your own PC.

![A voxel ship in StarMade's procedurally generated universe](https://gamezservers.com/games/starmade/shot-1.webp)

## What you need

- **The StarMade game files.** Install through Steam or the [official launcher](https://www.star-made.org/download). The server uses the same files as the client.
- **64 bit Java.** Memory flags above about 1.5 GB fail on 32 bit Java. Run `java -version` to check.
- **RAM to spare.** 4 GB for the server alone in a small group, 6 GB for a faction server with 15 or more players, 8 GB when players spread across many systems.
- **A connection that accepts incoming traffic.** If you are behind CGNAT, port forwarding will not help. [How to tell if you are behind CGNAT](https://gamezservers.com/guides/how-to-tell-if-you-are-behind-cgnat) explains the quick test.

## Step 1: Put the files in a server folder

Copy the installed StarMade folder (the one with `StarMade.jar` in it) to a dedicated location like `C:\StarMadeServer` or `~/starmade-server`. Keeping the server separate from your client install means a launcher update on your PC does not change the server version under your players, and the reverse.

On a headless Linux machine, copy the folder over from a PC where the launcher installed it, or use the launcher on that machine if it has a desktop.

## Step 2: Start the server once

From inside the folder, run:

```bash
java -Xms1024m -Xmx4096m -jar StarMade.jar -server -port:4242
```

- `-Xmx4096m` is the maximum memory, here 4 GB. Raise it as the universe grows, but leave room for the operating system.
- `-server` starts the dedicated server without the game window.
- `-port:4242` sets the listening port. Change it only if you run more than one server on the machine.

On Windows, save that line in a `start.bat` file so you can double click it. On Linux, run it inside `screen` or `tmux` so it keeps going after you log out.

The first start takes a while because it generates the universe. When it finishes, the folder has a `server.cfg`, a `server-database` folder with the universe, and text files for admins, bans and the whitelist.

## Step 3: Stop it and edit server.cfg

Stop the server cleanly by typing `/shutdown 0` in its console, then open `server.cfg`. Always edit with the server stopped, because the server can write the file back on shutdown and undo your changes.

The settings most owners change first:

| Setting | Default | What to set |
| --- | --- | --- |
| `MAX_CLIENTS` | 32 | Your real player cap. Lower is kinder to RAM. |
| `SERVER_LIST_NAME` | NoName | The name players see. Up to 64 characters. |
| `SERVER_LIST_DESCRIPTION` | NoDescription | One line about the server. Up to 128 characters. |
| `ANNOUNCE_SERVER_TO_SERVERLIST` | false | `true` to appear in the public list. |
| `HOST_NAME_TO_ANNOUNCE_TO_SERVER_LIST` | empty | Your public IP or domain. Required for the list. |
| `USE_WHITELIST` | false | `true` for a friends only server using `whitelist.txt`. |
| `PROTECT_STARTING_SECTOR` | false | `true` to stop griefing at spawn. |
| `ENEMY_SPAWNING` | true | `false` for a peaceful build server. |
| `THRUST_SPEED_LIMIT` | 75 | Top speed in m/s. Higher feels faster but loads sectors faster too. |
| `SECTOR_SIZE` | 2000 | Leave it alone on an existing universe. |

Two settings deserve a warning. `SECTOR_SIZE` changes how the whole universe is laid out, so set it before anyone builds or leave it at the default. `USE_STARMADE_AUTHENTICATION` and `REQUIRE_STARMADE_AUTHENTICATION` tie player names to registry accounts at star-made.org. Turning on the require option stops name spoofing but blocks anyone without a registered account.

## Step 4: Open the port

StarMade uses TCP, port 4242 unless you changed it.

1. Allow it in the firewall. Windows: `netsh advfirewall firewall add rule name="StarMade" dir=in action=allow protocol=TCP localport=4242`. Linux with ufw: `sudo ufw allow 4242/tcp`. See [Windows firewall rules for a game server](https://gamezservers.com/guides/windows-firewall-rules-for-a-game-server) for the menu route.
2. Reserve the server machine's local IP in your router.
3. Forward TCP 4242 to it. The [port forwarding guide](https://gamezservers.com/guides/how-to-port-forward-a-game-server) covers the common routers.

## Step 5: Make yourself admin and connect

Start the server again. Then:

1. In the server console, type `/add_admin YourName`, using the exact name you play under. You can also put the name on its own line in `admins.txt` before starting.
2. On your PC, open StarMade, choose **Online Play**, type `your.public.ip:4242` in the field at the bottom and connect. From the same network, use the local IP instead.
3. Once in, try `/god_mode YourName true` to confirm admin works, then turn it off.

The full set of commands for running the universe is in [StarMade admin commands](https://gamezservers.com/guides/starmade-admin-commands).

![A StarMade station in orbit](https://gamezservers.com/games/starmade/shot-2.webp)

## Keeping the universe healthy

- **Back up `server-database` and `blueprints`** before every StarMade update and before big faction wars. A corrupted database is the one thing you cannot rebuild.
- **Keep everyone on the server's build.** When the launcher updates a player's client and not the server, they get a version error. Players can pick an older build in the launcher, or you update the server. [StarMade can't connect to server](https://gamezservers.com/guides/starmade-cant-connect-to-server) covers this and the other join errors.
- **Watch memory, not CPU, first.** Big ships and many loaded sectors are what eat RAM. If the server lags around fleets, cap ship size through blueprint rules or lower `MAX_CLIENTS`.
- **Run `/force_save` before a planned restart** so nothing built in the last few minutes is lost.

## The easier route

A faction server only works if it is online when people want to play, and a home PC running a Java process with 6 GB of heap gets old quickly. A [GamezServers StarMade server](https://gamezservers.com/games/starmade) is live in about a minute with its own address and no ports to forward, lets you pick the server jar in the panel, and gives you the file manager and SFTP for `server.cfg`, blueprints and admin files. One click backups before a war night, and plans you can resize as fleets grow. For a crew sharing one universe, [splitting the bill](https://gamezservers.com/split-the-bill-game-server-hosting) lets up to 10 friends each pay their share.

## FAQ

### What port does a StarMade server use?

TCP 4242 by default, set with `-port:` on the start command. Forward that port to the server machine.

### How much RAM does a StarMade server need?

4 GB for a small group, 6 GB for a faction server with 15 or more players and 8 GB for a busy universe. Set the Java maximum with `-Xmx`.

### Can I move my single player world to a server?

Yes. Copy the `server-database` folder from your client install into the server folder while both are stopped. Single player in StarMade runs a local server, so the format is the same.

### Why did my server.cfg changes disappear?

You edited the file while the server was running, and it wrote its settings back on shutdown. Stop the server, edit, then start it.

### Do players need a StarMade account to join?

Only if you set `REQUIRE_STARMADE_AUTHENTICATION` to true. By default any name can join, which is fine for a whitelisted friends server.
