# Install Sophia Stack X | Sophia Stack X

Source: http://sophiastack.sophiaxt.com/install

# Install Sophia Stack X

## On your computer

Download the program for your system:

SystemFile

Windows 10 or 11, 64-bit

[sophia-windows-x86\_64.exe](/download/sophia-windows-x86_64.exe)

Linux, 64-bit (x86\_64)

[sophia-linux-x86\_64](/download/sophia-linux-x86_64)

There is no build for Macs or ARM processors yet. Sophia Stack X is free to use under the [SOPHIA XT license](/license).

Put the file in a folder of its own and open it. On Linux, make it runnable first with `chmod +x sophia-linux-x86_64`. Windows may warn you the first time, because the program is not yet signed with a Microsoft certificate. Choose **More info**, then **Run anyway**.

It then:

1.  Makes a `sophia-data` folder beside itself for your sites, pictures and settings.
2.  Starts on the first free local port from 8806 up.
3.  Opens the setup page in your browser.

Setup asks for your name, email and a password of at least 12 characters, then your site's name and a starting point: blank, business, blog or restaurant. When you finish you are signed in and looking at your new site in the admin.

The window that opened with it is the server. Close it, or press Ctrl+C, to stop. Open the program again to carry on where you left off.

## On a Linux server

You need a 64-bit Linux server with systemd and root access, plus a domain name pointing at the server. Run this as root:

```
curl -fsSL https://sophiastack.sophiaxt.com/download/install.sh | sudo sh -s -- --domain example.com,www.example.com --tls-email you@example.com
```

The installer:

1.  Downloads the program and checks it against its published SHA-256 checksum. If they differ, it stops and installs nothing.
2.  Installs it under `/opt/sophia`, running as its own account in a locked-down systemd service that listens only on `127.0.0.1`.
3.  Sets up nginx or Caddy in front for your domain, if one is installed.
4.  Gets an HTTPS certificate from Let's Encrypt when you give `--tls-email`. Passing it accepts Let's Encrypt's terms.
5.  Prints a one-time setup link. Until someone uses that link, the setup page turns everyone away, so a stranger who finds your address first cannot become the owner.

Useful options:

OptionWhat it does

`--domain a.com,www.a.com`

Names to serve. Without it, only `127.0.0.1` reaches the site.

`--tls-email you@a.com`

Get an HTTPS certificate with certbot (nginx). Caddy handles HTTPS itself.

`--install-proxy`

Install nginx and certbot when the server has no web server.

`--proxy nginx|caddy|none`

Choose the web server, or leave it alone with `none`.

`--behind-https`

Something else in front (a load balancer, Cloudflare) already provides HTTPS.

`--http-port 8806`

The local port the program listens on.

`--name sophia`

The service and account name. Use another name to run a second install.

The installer never changes a web server setting for a domain another site on the server already uses. It tells you instead. If nginx or Caddy rejects the new settings, it takes them back out.

If you run your own web server in front, send requests to `127.0.0.1:8806` and set the `X-Real-IP` header to the visitor's address. Sign-in limits and spam checks count by it.

## Updating

On a server, as root:

```
sudo /opt/sophia/current/sophia update --latest
```

This fetches the list of the newest files and checks its signature against the SOPHIA XT release key built into every copy of the program. Then it downloads the new program and checks that its SHA-256 matches the signed list. If either check fails, nothing changes.

The update stops the service, copies the database, switches to the new version and waits for it to answer. If it does not answer within 30 seconds, the previous version and that database copy come back by themselves. Three versions and three database copies are kept.

On your own computer, download the new file and open it in place of the old one. Your `sophia-data` folder stays where it is.

## Checking a download yourself

Every file has a checksum beside it at `/download/<file>.sha256`. On Linux:

```
sha256sum -c sophia-linux-x86_64.sha256
```

On Windows PowerShell, compare the output of `Get-FileHash sophia-windows-x86_64.exe` with the `.sha256` file.

`/download/latest.json` lists every file with its checksum, and `/download/latest.json.sig` is its Ed25519 signature. The public half of the release key is at [/download/release-key.pub](/download/release-key.pub).

## Moving a site you built on your computer

If you have the developer setup (see [Deploying](/docs/deploy)), `sophia deploy` sends your sites, pictures and accounts to a server over ssh in one command. Otherwise, back up under **This install > Security** and restore the backup on the server.
