Deploying a Speckle Server


#1

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/

#2

This post needs some serious updating!


#3

Deployed one yesterday with docker - much easier!


#4

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!


#5

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


#6

@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! ( https://github.com/speckleworks/SpeckleServer/blob/master/readme.md)


#7

I am brave enough :wink: Will do!
I’ll have more questions soon, will join the slack channel…


#8

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

#9

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


#10

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.


#11

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


#12

Heya! what errors are you still getting?


#13

Hi @dimitrie

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


#14


#15

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/


#16

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


#17

Hi,

I tried setting up a speckle server following the guides in the repo here: https://github.com/speckleworks/SpeckleServer

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: https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-16-04

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: https://forums.docker.com/t/docker-host-env-variable-uses-and-documentation/24531

Someone run into the same issue? I’m really new to this…


#18

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.


#19

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


#20

Have still got the same issue with https not working on the api path as reported here: https://github.com/speckleworks/SpeckleServer/issues/98.

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.