# Installation

Download and install a simple SocketXP agent to run on the device or system where your web application or SSH server also runs. SocketXP agent is a CLI utility with which you could configure and create secure tunnels to your localhost web application or SSH server.

# Linux

$ curl -O https://portal.socketxp.com/download/linux/socketxp && chmod +wx socketxp && sudo mv socketxp /usr/local/bin

# Linux 32-bit

$ curl -O https://portal.socketxp.com/download/linux32/socketxp && chmod +wx socketxp && sudo mv socketxp /usr/local/bin

# MacOSX

$ curl -O https://portal.socketxp.com/download/darwin/socketxp && chmod +wx socketxp && sudo mv socketxp /usr/local/bin

# Windows

# Windows (32 bit)

# ARM

$ curl -O https://portal.socketxp.com/download/arm/socketxp && chmod +wx socketxp && sudo mv socketxp /usr/local/bin

# ARM64 (aarch64, arm64, v8)

$ curl -O https://portal.socketxp.com/download/arm64/socketxp && chmod +wx socketxp && sudo mv socketxp /usr/local/bin

# ARMv5

$ curl -O https://portal.socketxp.com/download/armv5/socketxp && chmod +wx socketxp && sudo mv socketxp /usr/local/bin

# Docker Container

$ docker pull expresssocket/socketxp

Create a config.json file (explained below) in your local directory and map it as a volume inside the container at /data directory as shown in the example below.

$ docker run -d  -v /home/user/data:/data expresssocket/socketxp
25ad610483f7a324858b79f94de5356c37b3997abc8d105d0eb8ca004c27ec54
$ docker logs 25ad
Using config file: /data/config.json
Login Succeeded.
User [] Email [test-[email protected]].
Connected.
Public URL -> https://test-user-abcdef1234.socketxp.com

Here is the content of a sample config.json file for the docker container.

$ cat /home/user/data/config.json
{
    "authtoken": "",
    "tunnels" : [{
        "destination": "https://172.10.0.1:8123",
        "custom_domain": "",
        "subdomain": ""
    }]
}

Where 172.10.0.1 is the IP address of the other docker container running your web application (Eg; Python Flask web app or NodeJS web app or a Java web app)

# Verify Installation:

After installing the SocketXP agent, check if it can be executed successfully.

$ socketxp

Usage:    socketxp [OPTIONS] COMMAND

Socketxp - secure remote access to your IoT devices.

	SocketXP is a cloud based IoT platform that enables users to remotely connect, manage and control IoT devices and IoT web applications running in a private network behind NAT router and firewall.

By using this product, you are agreeing to the terms of SocketXP. Terms of service can be found at: https://www.socketxp.com/tos/

Don't have an account? Create a free account here: https://portal.socketxp.com/#/login

If you have any questions or security related issues, please contact us via email: [email protected]

Options:
      --auto-update        Enable SocketXP agent software auto-update feature
      --config string      config file (default is
                           $HOME/.socketxp/config.json)
      --gateway-port int   Specify an optional SocketXP Cloud Gateway
                           Port to connect (default 80)
      --help               Print usage
  -v, --version            Print SocketXP agent version and build information

Management Commands:
  device      Manage IoT devices - List devices, Delete devices
  service     Install and run socketxp as a background service
  tunnel      Manage tunnels - bidirectional channels that expose internal services to the internet

Commands:
  connect     Connect the supplied local destination to the public endpoint
  login       Login to the SocketXP service.  Obtain an auth token from https://portal.socketxp.com

Run 'socketxp COMMAND --help' for more information on a command.

# Uninstall SocketXP Agent:

To uninstall SocketXP agent from your device execute the following commands:

sudo rm -rf /usr/local/bin/socketxp
sudo rm -rf /var/lib/socketxp
sudo rm -rf /etc/socketxp