> For the complete documentation index, see [llms.txt](https://docs.goodcrypto.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.goodcrypto.app/goodcryptox-3.0/readme/set-up-on-a-nas.md).

# Set up on a NAS

A NAS at home runs goodcryptoX day and night with nothing to rent; the steps use a Synology, other makers' container apps take the same file.

A NAS at home runs goodcryptoX day and night, with nothing to rent. Start here, or start on your Mac and move it here later in one file. The steps below use a Synology; other makers' container apps take the same file.

## Check your NAS

goodcryptoX needs three things:

1. **The maker's container app:** Synology Container Manager, QNAP Container Station, Asustor Docker Engine, UGREEN Docker, TerraMaster Docker Manager.
2. **At least 2 GB of memory installed,** with about 1 GB left free.
3. **A 64-bit processor** (x86-64 or ARM64).

On Synology, the Plus models from 2018 on (DS218+, DS220+, DS224+, DS920+, DS923+ and others) and the DS223 and DS423 qualify. The j and play models, the DS124, and the DS118, DS218 and DS418 do not. Not sure? Ask in the goodcryptoX Telegram group, [t.me/goodcrypto](https://t.me/goodcrypto), with your exact model.

## Start goodcryptoX

1. In **Package Center**, install **Container Manager**.
2. Download goodcryptoX's compose file: [compose.yaml](https://github.com/GoodCryptoApp/gcx/releases/latest/download/compose.yaml).
3. In Container Manager, **Project › Create**: name it `gcx`, set its path to a new folder on the NAS's own disk (such as `docker/gcx`), choose **Upload docker-compose.yml** and pick the file. Press **Next** until **Done**. goodcryptoX starts.

The file is goodcryptoX's latest release on GitHub.

<details>

<summary>If this does not work</summary>

Choose **Create docker-compose.yml** instead of the upload, and paste the file's text:

```yaml
services:
  gcx:
    image: ghcr.io/goodcryptoapp/gcx:latest
    container_name: gcx
    network_mode: host
    init: true
    restart: unless-stopped
    stop_grace_period: 60s
    volumes: [gcx-data:/data, gcx-secret:/secret]
  updater:
    image: ghcr.io/goodcryptoapp/gcx:latest
    container_name: gcx-updater
    entrypoint: [gcx, updater]
    user: "0:0"
    network_mode: none
    init: true
    restart: unless-stopped
    volumes: [/var/run/docker.sock:/var/run/docker.sock, /root/.docker:/docker:ro, gcx-data:/data]
volumes:
  gcx-data: {name: gcx-data}
  gcx-secret: {name: gcx-secret}
```

</details>

## Sign in

In Container Manager, open the `gcx` container and its log. At the first start its first lines show a link: copy it, paste it into the browser on your computer and create a passkey with Touch ID or your computer's own unlock. goodcryptoX opens at my.goodcrypto.app. Your phone comes next, from the panel: Settings › Devices › **Add a device** shows a QR code that scans.

The first link is one-time: it dies the moment a device uses it. It also expires after 10 minutes: for a fresh one, restart the container, or run `gcx pair` in the container's terminal. The link is a key: never share it or paste it anywhere.

The link goes through goodcryptoX's relay.

<details>

<summary>If this does not work</summary>

Reach goodcryptoX through a tunnel instead. Turn on SSH on the NAS (**Control Panel › Terminal & SNMP › Terminal › Enable SSH service**; only an administrator account may sign in). On your computer, open Terminal (PowerShell on Windows), run this line with your user and the NAS's address, enter your password, and keep the window open:

```
ssh -N -L 8128:127.0.0.1:8128 <user>@<your NAS's address>
```

In a second window, sign in to the NAS with `ssh <user>@<your NAS's address>`, run `sudo docker exec gcx gcx open --print`, and open the link it prints in your browser within 60 seconds. goodcryptoX opens at `http://localhost:8128/gcx`. A network address such as `http://192.168.1.20:8128` opens it only once you turn on **Connect directly at home**, below.

</details>

From here, everything is as on a server: [adding a phone or another computer](https://docs.goodcrypto.app/goodcryptox-3.0/readme/set-up-on-a-server.md#add-a-phone-or-another-computer), [updates and backups](https://docs.goodcrypto.app/goodcryptox-3.0/readme/set-up-on-a-server.md#updates-and-backups).

### Your home network

goodcryptoX can open on your home network directly, without our server: turn on one switch, and the page shows one link. Open that link on any device at home, and goodcryptoX is there. It is off until you turn it on, on a Mac, Windows, Linux, a NAS or a server.

#### Turn it on

1. Open goodcryptoX the way you already do: at the machine, through my.goodcrypto.app, or with the link the install printed. You can do this from anywhere, even from a phone that is not at home.
2. Open **Settings › Devices** and turn on **Connect directly at home**, in the **Home network** card at the bottom.
3. The card shows one link and its QR code: "Open this link or scan the QR code on any device on your home network".

The link stays the same until you turn the switch off. Keep it where you keep things: in your browser, in a note, in a message to yourself.

If the computer's firewall asks whether goodcryptoX may accept connections, or blocks it, allow it.

#### Connect a device

Open this link or scan the QR code on any device on your home network. Click the link text or **Copy** to copy it, then paste it into that device's browser; on a phone, you can scan the QR code with its camera. goodcryptoX opens, and the device is in. Do the same on each device at home.

The device then opens goodcryptoX at that address from the browser's history, or from the same link again: a device that is already in opens it with no second step and no new row in Devices.

On a Mac or an iPhone, the browser may first ask whether it may find devices on your local network: allow it. If the page says the address is unreachable, allow the browser under System Settings › Privacy & Security › Local Network (on an iPhone: Settings › the browser › Local Network) and reload.

#### On a NAS or a server

Through my.goodcrypto.app you turn it on in Settings › Devices, as above. With no contact with our server, or before any device is in, the machine's log says how at every start: "Connect directly at home: gcx network on in the container's Terminal, or docker exec gcx gcx network on".

1. Open the container's Terminal (on a NAS, the `gcx` container in Container Manager; on a server, your provider's console).
2. Run `gcx network on` (from the machine's shell: `sudo docker exec gcx gcx network on`). It prints the link and its QR code.
3. Copy the link and open it in the browser on your laptop.

While no device is in, the log prints the same link at every start. The link is a key: anyone who reads the container's log can see it, so keep the log to yourself.

If the suggested address is not the one your laptop reaches, give it yourself: `gcx network on http://192.168.1.20:8128`, with your machine's address and the port goodcryptoX prints. The command lists the machine's other addresses too, to choose from.

A goodcryptoX that runs as a service on a computer without a screen (not in Docker) prints no such line at start: run `gcx network on` in its shell.

* `gcx network` says whether it is on, at which addresses, and prints the link.
* `gcx network off` turns it off.
* **No contact with our server at all:** set `GCX_PHONE_RELAY: ""` on the `gcx` service in the compose file, before its first start. Once goodcryptoX has started with our server, turning the switch on does not undo that first contact. With our server off, **Add a device** is not shown: the home link is the way in.
* **The shipped compose file** (the machine's own network) needs no change for the switch. Off, goodcryptoX answers on the machine itself only, as before; on, on the machine's addresses. If a firewall sits in front of the NAS or server, it must let the port through.

#### Who can open it

Turn this on at home, on a network you trust. Do not forward the port on your router.

Anyone who has this link and is on your network can add a device while it is on. The link works wherever it was shown or sent: a screenshot, a chat, the machine's log. You see every device in **Settings › Devices**: remove any device you did not add. To end the link itself, turn the switch off and on again: that makes a new link, and the old one stops working. Devices you already added open goodcryptoX again when you turn it back on, until you remove them.

Anyone else who opens the address sees only the logo and "To open goodcryptoX in this browser, use the home link from Settings › Devices on a device where it is open."

If a device is lost or you suspect someone else got in: remove the device, turn the switch off and on again for a new link, then check Devices and remove any device you did not add; revoke keys made meanwhile and any key that may have been copied.

A device you add here can do what you can do at your computer, trading and changing settings included, unless you set it to **Read-only**. A Read-only device sees the address and never the link. HTTP carries the page, the link and the sign-in in the open: someone who can read your network's traffic can copy them; your own HTTPS address protects against that.

#### On a laptop

On a laptop, turning on **Connect directly at home** first shows a warning: choose **Turn on** to continue, or **Cancel** to leave it off. This pop-up appears only on a laptop. While on, the card keeps the same words in quiet grey text at the switch: "On any Wi-Fi MacBook-Pro joins, anyone on it can open goodcryptoX with this link", with your machine's name. The home network is whichever Wi-Fi the laptop is on, a café's or a hotel's too: anyone there who has the link can add a device. Turn it off before you leave home, or keep the link to yourself. goodcryptoX knows a laptop by its battery or its case; it cannot tell from inside Docker (Docker Desktop on a laptop shows no line), and when the reading fails it shows none.

#### What "home network" means

goodcryptoX answers devices on the networks your machine is on, and on your own VPN into your home; it turns away the rest of the internet. That check is best effort, not a lock: a proxy, a VPN or a router that forwards traffic can pass it, and the connection a VPN sends your traffic through is not your home network. It does not know which Wi-Fi a device is on, or tell a guest from a family member. What keeps others out is the link, and the devices you keep.

#### Your own address

If you already reach your machine by a name of your own, through your own HTTPS proxy (Caddy, nginx), give it at the machine: `gcx network on https://gcx.example.com`. goodcryptoX saves it, turns the switch on and shows the link at that address. A name also keeps your devices in when the machine's address changes. HTTPS at home without a proxy of your own is planned for a later version.

<details>

<summary>Proxy settings</summary>

Caddy's default works:

```caddyfile
gcx.example.com {
    reverse_proxy 127.0.0.1:8128
}
```

nginx must keep the browser's Host and pass WebSockets; the usual `X-Forwarded-*` lines may stay. Put the map in nginx's `http` block, and the location inside your existing HTTPS server for that name:

```nginx
map $http_upgrade $gcx_connection {
    default upgrade;
    '' close;
}
location / {
    proxy_pass http://127.0.0.1:8128;
    proxy_http_version 1.1;
    proxy_set_header Host $http_host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $gcx_connection;
}
```

Use the port goodcryptoX prints in place of 8128. If a page says "This address is not available", the proxy changed the Host: keep it as the browser sent it.

A proxy on this machine that passes goodcryptoX a `localhost` address reaches it as this machine does, and the switch off does not close it: restrict or remove that proxy yourself.

</details>

#### Your devices

* Each device added this way has its row in **Settings › Devices**, marked **Home network**, with **Can trade** or **Read-only** and **Remove**. Remove ends it at once.
* A device unused for 90 days must be added again. One you use stays signed in. Your browser keeps its sign-in for the address it was added at, so the same machine at another address (a name instead of a number) is added again; the browser may also forget it sooner if you clear its data.
* A phone that uses both our server (away) and the home link (at home) has two rows: one for each way in. Remove removes the row you press.
* Turning the switch off closes goodcryptoX to every home-network device; their rows stay, and turning it on again lets them back in. Devices that use our server are not affected (Phone access).
* Away from home, connect to your own VPN into your home network and open the same address, or use our server (Phone access).
* Sign in with Binance works at your home-network address, such as 192.168.1.20. At your own address (a name), use a self-generated API key.

#### Connect a wallet at this address

A wallet connects at the home address as it does anywhere else: a wallet extension in your browser (MetaMask, Rabby and others), or a phone wallet by scanning the QR code. Opening the wallet window sends Reown / WalletConnect the page's address, your home-network address included (see the privacy policy). The QR code needs their servers to be reachable.

A wallet doesn't encrypt your connection to goodcryptoX: at the home address it stays plain HTTP. If you don't trust that network, use [your own address](#your-own-address) with HTTPS, or open goodcryptoX through our server (Phone access).

If the wallet service ever refuses this address, the wallet window closes and a line under **Connect wallet** says what to do instead: "Phone wallets can't connect at this address. Use a wallet extension in this browser, or open this page in your wallet app's browser." **More ways** adds goodcryptoX through our server, or an SSH tunnel. Until you reload the page, the window lists only the wallets in your browser; with none, Connect wallet says "No wallet extension in this browser".

#### If something goes wrong

* **The link no longer works:** the switch was turned off, and turning it on made a new link. Open the new one from **Settings › Devices** on a device that is in, or run `gcx network` at the machine.
* **The page shows "To open goodcryptoX in this browser, use the home link from Settings › Devices on a device where it is open."** The device is not added: it was removed, unused for 90 days, or its browser forgot it. Open the link again.
* **Every device is lost:** at the machine's console run `gcx network` (`gcx network on` if the switch is off) and open the link it prints. There is no e-mail reset.
* **The address changed** (a router can hand out another), **or the browser's data was cleared:** open the link again from **Settings › Devices**: it names the new address. [Your own address](#your-own-address) avoids the first.
* **The card says "goodcryptoX is locked":** unlock goodcryptoX first; the link shows again. Devices already added, and the link itself, keep working meanwhile.
* **After you moved goodcryptoX with Bring** from a device that was open on the home network: the new machine starts with the switch off, no home-network devices and no link, so that device loses goodcryptoX at the restart. Turn the switch on there and open its new link.

## Proxy

A proxy sends every exchange connection through an address you choose, on a computer, a NAS or a server.

Open **Settings › General › Privacy & security › Proxy**, turn **Proxy On**, enter `socks5://host:port` or `http://host:port`, and press **Save**. With no saved address, Save turns it on. With an address saved, the switch saves at once; Off keeps the address for next time. The saved address masks its password; **Edit** opens it with **Save** and **Cancel**, and **Remove** clears it and turns Proxy off. An empty field shows no warning; an address that is not a SOCKS5 or HTTP address warns at the field after Save and is not saved. If the proxy needs a login, use `socks5://user:password@host:port` or `http://user:password@host:port`; encode special characters in the login (for example, `@` as `%40`). Use a proxy you trust. Existing exchange streams reconnect through it without restarting goodcryptoX. If the proxy fails, goodcryptoX alerts you; check the address and login, or turn Proxy Off to connect directly.

For a terminal or Docker installation, set `GCX_PROXY=socks5://host:port` (or the HTTP address) in its environment before starting goodcryptoX. Once you save Proxy in Settings, that choice wins over the environment, including Off. The proxy covers exchanges; goodcryptoX's relay, reports, updates and other services connect directly.

On a server or NAS, you can run a VPN through a Gluetun sidecar: add the service below to your existing Compose file, fill in your VPN provider's details, and keep goodcryptoX's `network_mode: host`. Only Gluetun uses the VPN; goodcryptoX's services stay direct. Start the updated project, then save `http://127.0.0.1:8888` in Proxy (or set `GCX_PROXY` on the `gcx` service). The proxy port is available only on this machine. The VPN provider must support the OpenVPN credentials you supply; a NAS must have `/dev/net/tun` and allow the `NET_ADMIN` capability.

```yaml
  gluetun:
    image: qmcgaw/gluetun:latest
    cap_add: [NET_ADMIN]
    devices: [/dev/net/tun:/dev/net/tun]
    environment:
      VPN_SERVICE_PROVIDER: <your-vpn-provider>
      VPN_TYPE: openvpn
      OPENVPN_USER: <your-vpn-user>
      OPENVPN_PASSWORD: <your-vpn-password>
      HTTPPROXY: "on"
    ports: ["127.0.0.1:8888:8888/tcp"]
    restart: unless-stopped
```

## Questions

### Which NAS can run goodcryptoX?

One with the maker's container app, at least 2 GB of memory and a 64-bit processor. On Synology, the Plus models from 2018 on and the DS223 and DS423 qualify.

### Does goodcryptoX on a NAS trade while my computer is off?

Yes: the NAS runs goodcryptoX day and night, and you open it from your computer or your phone.

### Where is my data?

In two Docker volumes, `gcx-data` and `gcx-secret`: back them up together, since `gcx-data` alone cannot open your keys.

### Can I start on my Mac and move to a NAS later?

Yes: **Export** on your Mac and **Bring** in the NAS's panel; your browser sends the file, accounts and bots included ([Moving goodcryptoX](https://docs.goodcrypto.app/goodcryptox-3.0/readme/moving-goodcryptox.md)).

### Do I still need your server?

No: at home your devices open goodcryptoX directly. Away from home, use your own VPN into your home or our server ([Phone access](https://docs.goodcrypto.app/goodcryptox-3.0/readme/phone-access.md)).
