by Liquid Labs
A robust Minecraft server management tool using Google Cloud. Cloudcraft will set up, backup, start, stop, and destroy cloud based Minecraft servers.
Status note: This has been manually tested relatively thouroughly and, at the same time, everything is spretty new.
- Install terraform if not installed (check with
terraform --version
). - Install gcloud CLI if not installed (check with
gcloud --version
). - Install Cloudcraft:
npm i -g cloudcraft
gcloud auth application-default login # authenticate to gcloud, if necessary
# start and run a new Minecraft server
cloudcraft server create -- name='my-mc-server' start
You will have to (potentially) pay for a few thins. Overall, costs (for a 24x7 server) are comparible to the monthly cost of a premium Minecraft hosting service with similar RAM capacity.
- Your disk storage, which is pretty cheap.
- The time your server is running. This is probably the most expensive thing and stopping the server when not in use can save you a lot of money.
- Data ingress and egress. At the time of writing, there was a significant amount of free data transfer per month, but a larger, 24x7 server would probably start to incur some costs for data transfer as well.
- Terraform main and vm-instance module documentation.
cloudcraft <options> <command>
Option | Description |
---|---|
<command> |
(main argument,optional) The command to run or a sub-command group. |
--quiet , -q |
Makes informational output less chatty. |
--throw-error |
In the case of an exception, the default is to print the message. When --throw-error is set, the exception is left uncaught. |
backups
: Selects backup commands.create
: Creates a Minecraft named {underline server-name}..destroy
: Destroys the named server or all resources.help
: With no command specified, prints a list of available commands or, when a command is specified, prints help for the specified command.info
: Prints info about the Minecraft server(s).list
: Lists Cloudcraft managed Minecraft servers.ssh
: Displays the proper SSH command or executes specified command on remote server.start
: Starts the named Minecraft server.status
: Displays the status of a Minecraft server.stop
: Stops the named Minecraft server.terraform
: Runs the terraform command, as specified, in the staged Cloudcraft terraform directory. This command is meant primarily for developers.
Selects backup commands.
Option | Description |
---|---|
[command] |
(main argument,required) The backup action to perform. |
create
: Backs up the named server.delete
: Deletes the named or chosen backups.list
: Lists the current backups.restore
: Restores the named or chosen backup.
Zips the remote server files and copies them to the cloudcraft data directory.
create
options
Option | Description |
---|---|
[server-name] |
(main argument,required) Name of the server to backup. |
Deletes the specified backup file(s) or, if none specified, asks the user to choose one or more files for deletion.
delete
options
Option | Description |
---|---|
<backup-files> |
(main argument,optional) The backup file(s) to delete. |
--confirm |
If set, then the 'yes/no' confirmation will be skipped. |
Lists the current backups.
list
options
Option | Description |
---|---|
--format |
Specifies the format of the output. Can be 'terminal' (default), 'json', or 'yaml'. |
Restores the specified backup or, if none specified, asks the user to choose a backup to restore. By default, the backup will be restored to the server from which it originated. This can be changed with the '--target' option.
restore
options
Option | Description |
---|---|
<backup-file> |
(main argument,optional) The backup file to restore. |
--confirm |
If set, then the 'yes/no' confirmation will be skipped. |
--target |
The server to restore the backup to. |
Creates a Cloudcraf managed minecraft server named server-name. By default this is a bedrock server.
Option | Description |
---|---|
[server-name] |
(main argument,required) The name of the server to create. |
--server-type |
May be one of: bedrock, java. |
Destroys the named server or all resources.
Option | Description |
---|---|
<server-name> |
(main argument,optional) The name of the server to destroy. |
--all |
If true, then destroys all infrastructure. Incompatible with '--server-name'. |
--confirm |
If set, then the 'yes/no' confirmation will be skipped. |
--plan |
Prints the destroy plan without actually doing anything. |
With no command specified, prints a list of available commands or, when a command is specified, prints help for the specified command.
Option | Description |
---|---|
<command> |
(main argument,optional) The command to print help for. |
Displays info about the servers or, if name supplied, a server. By default will display all information. If one or more info select options is provided, then it will only display that information.
Option | Description |
---|---|
<server-name> |
(main argument,optional) The name of the server to get into on. |
--select-fields |
List a field to display. Common options include: project-id, ip-address, machine-type, server-memory, and server-type. Underscores and hyphens are interchangeable. May be specified multiple times to select multiple fierds. |
--refresh |
Updates underlying terraform files and applies the results before reading the output. |
Lists Cloudcraft managed Minecraft servers. When the (primary) option '--quiet' is 'true', then it will output nothing if there are no servers. Otherwise, it prints a human readable message.
The 'ssh' command, with no options, is used to generate and display the SSH command you would use to log into the specified server. With '--eval-mode', you can do:
eval $(cloudcraft ssh --eval-mode some-sever
You can also use the --command
option to execute a single command.
Option | Description |
---|---|
[server-name] |
(main argument,required) The name of the server to log into. |
--command |
Will run the specified command and exit. |
--eval-mode |
Produces output suitable to 'eval $(cloudcraft ssh a-server)'. |
Starts the named Minecraft server.
Option | Description |
---|---|
[server-name] |
(main argument,required) The name of the server to start. |
--refresh |
Updates and applies the terraform configuration before starting the server. |
Tries to determine the if the server is up, it's ping status, and disk usage.
Option | Description |
---|---|
[server-name] |
(main argument,required) The name of the server to describe. |
--no-ping |
Skips the ping test when set. |
--refresh |
Updates and applies the terraform configuration before resolving the server status. |
Stops the named Minecraft server.
Option | Description |
---|---|
[server-name] |
(main argument,required) The name of the server to stop. |
--refresh |
Updates and applies the terraform configuration before stoping the server. |
The entire command (everything after 'cloudcraft') is executed from the Cloudcraft terraform staging directory. E.g., 'cloudcraft terraform plan -no-color' executes 'terraform plan -no-color'.