Deploying a Speckle Server

UPDATE: this thread was regarding Speckle 1.0. To learn how to deploy a Speckle 2.0 server (either using Digital Ocean or manually) check out the docs here!

Please note: this is a quite insecure way of deploying the speckle server. It is, nevertheless, fast and gives a quick satisfaction :) You can follow this tutorial for a local install just as well; just skip to part 3 (install mongo).


This is a companion discussion topic for the original entry at https://speckle.works/doc/deployaserver/
1 Like

This post needs some serious updating!

2 Likes

Deployed one yesterday with docker - much easier!

3 Likes

What troubles (if any) were there Matthew? Or was it really just a matter of actually following the instructions in the repo? Would be surprised!

Hi,
This looks like a gorgeous project so Iā€™m giving it a try. I installed SpeckleServer on a Debian Sid machine, and I did the following steps, might be useful to someone else:

  1. install mongodb and redis server: sudo apt-get install mongodb redis
  2. Since I donā€™t want to have both the redis and mongo servers running all the time (Iā€™m just testing for now), I disabled both startup scripts: sudo systemctl disable mongodb and sudo systemctl disable redis-server
  3. Clone SpeckleServer: git clone https://github.com/speckleworks/SpeckleServer.git
  4. Edit config.js and adjust the mongo url line: url: process.env.MONGODB_URI || process.env.MONGO_URI || 'mongodb://localhost:27017/speckle' and the redis url line: url: process.env.REDIS_URL || 'redis://localhost:6379'
  5. Stop both mongo and redis processes that were started by apt-get: sudo systemctl stop mongodb and sudo systemctl stop redis-server
  6. Start mongo: mongodb --dbpath /path/to/some/folder (create a folder somewhere to store the db)
  7. Start redis: redis-server
  8. Start Speckle: node server.js

Any problem, test the mongodb connection by running mongo and the redis server by running redis-cli

2 Likes

@yorik, nice - thanks for the detailed instructions! if you feel brave enough, you can do a pr with those lines for the readme of the server repo, would be good reference for future self-hosting astronauts! ( SpeckleServer/readme.md at master Ā· speckleworks/SpeckleServer Ā· GitHub)

I am brave enough :wink: Will do!
Iā€™ll have more questions soon, will join the slack channelā€¦

quick and maybe uncomplete howto install speckle on windows 10.

How to install speckle server on windows 10:

  1. download and install node.js https://nodejs.org/en/download/ - windows installer (.msi) 64-bit
  2. download and install a microsoft port for redis 3.2.100 https://github.com/MicrosoftArchive/redis/releases - Redis-x64-3.2.100.msi
  3. download and install mogodb community server https://www.mongodb.com/download-center?jmp=nav#community - for Windows 64-bit x64
  4. download and install gitdesktop https://desktop.github.com/
  5. in gitdesktop File> Clone repository > URL (tab) - paste the url https://github.com/speckleworks/SpeckleServer.git and remember the local path / change it to somewhere simple.
  6. navigate to the github directory (the above local path) with a File Explorer. Make a new shortcut and type ā€˜cmdā€™. Edit the properties of the new shortcut and change the Start in: to the folder where github repository resides (the above local path)
  7. run the cmd shortcut and in that window type:
    cd SpeckleServer
    npm install
  8. To start the server, run the cmd shortcut and in that window type:
    cd SpeckleServer
    node server.js

Thanks @Ionut_Anton for the quick to-do guide.

So IT department decided to help setting up a windows 10 server.
After installation is complete the server returns this:
TypeError: JwtStrategy requires a secret or key

My knowledge about setting up servers is very limited, so any pointers would be helpfull.

Thanks

/Martin

Hi @martinromby,

my guess itā€™s a speckle.server error not related to a windows deployment.
from what i can figure itā€™s a passpoert error related to an env (environment) variable not set.
did you make a copy of the .env-base file, rename it to .env and modify it with your settings?

Hope it helps.

2 Likes

Hi @Ionut_Anton

Thank you for your quick reply.
It looks like the env did the trickā€¦ however, we are sadly not there yet.
You mention something about a config.js file to edit, but we canā€™t find any such file in our installation. Is it a file we have to copy to the installation afterwards and then edit?

We are trying to set up a Speckle Server om a Windows 10 1803.

Thank you in advance.

/Morten

Heya! what errors are you still getting?

Hi @dimitrie

We got it spinning :slight_smile: However, we are not sure what to paste in the Speckle login. Can you help? Thanks!

Hey @mthuesen! since youā€™ve registered online, in the gh or rhino plugins you will need to login (thatā€™s the last tab in the first screenshot you posted!).

For the server URL, http://YOUR_IP:3000/api/v1, and use your login details. Let me know how it goes!
PS: @teocomi published a guide for gh + dynamo recently here: https://speckle.works/log/speckle-guide/

Thanks for the server URL clarification @dimitrie.
Weā€™re upā€™nā€™runninā€™ !
Beers on us! :beers:

1 Like

Hi,

I tried setting up a speckle server following the guides in the repo here: GitHub - speckleworks/SpeckleServer: Speckle Server šŸš€

I have successfully set up a Docker droplet on Digital Ocean and ssh with root and also created a new user following the instructions here: Initial Server Setup with Ubuntu 16.04 | DigitalOcean

After this I executed the suggested commands in the ā€œ5 min Docker Installā€. However, when I run the docker-compose up command it gives the following error:


sigve@docker-speckle:~/speckle$ ls
docker-compose.yml
sigve@docker-speckle:~/speckle$ docker-compose up
ERROR: Couldnā€™t connect to Docker daemon at http+docker://localhost - is it running?

If itā€™s at a non-standard location, specify the URL with the DOCKER_HOST environment variable.


I read this:
With the exception of the local Docker Machine setup, configurations where itā€™s even possible to set $DOCKER_HOST to something else are dangerously insecure. Remember that being able to reach the Docker socket is equivalent to unrestricted root-level access over that system.

here: DOCKER_HOST env variable uses and documentation - Docker Cloud - Docker Forums

Someone run into the same issue? Iā€™m really new to thisā€¦

Hey Sigve, I just found this in a ā€œto approveā€ queue. Speaks volumes about my forum admin prowess :grimacing: sorry for the delay!

If still a valid question: i think the error youā€™re getting is just because docker itself is not started (this is needed by compose). if you run docker version you should see if itā€™s running or not.

If you installed docker as root and then switched to a new user, it will not be available, so most probably youā€™ll need to re-run the docker install as sigve and not as root.

Thanks! Tried to run it as root, and that worked out nice. Have it up and running now :+1:

1 Like

Have still got the same issue with https not working on the api path as reported here: Can't deploy to Heroku Ā· Issue #98 Ā· speckleworks/SpeckleServer Ā· GitHub.

ref. ā€œ@didimitrie interesting. It works with http but not with https when I follow your formula: https://YOUR_DROPLET_IP:3000/api/v1ā€

http works, but get ā€œThis site canā€™t be reached 167.99.216.1 unexpectedly closed the connection.ā€ when trying https://167.99.216.1:3000/api/v1.