Let's say you have installed a Sails web app named foo-app, meaning you did not use the --no-frontend or --minimal flags when creating the app. The sails lift or sails inspect command can be used to start the web app. The sails lift command can be issued in the directory of the web app (foo-app in this example). Notice that the & character is used to run the process in the background. This is because, by default, the process runs in the foreground, which ties up your command line prompt.
cd /opt/foo-app
sails lift --port 1337 &
By default, events will be logged at log level INFO. The --silly flag can be used to log events at log level silly.
sails lift --port 1337 --silly &
If the app is successfully started, something like this should be returned.
info: Starting app...
info: Initializing project hook... (`api/hooks/custom/`)
info: Initializing `apianalytics` hook... (requests to monitored routes will be logged!)
info: ·• Auto-migrating... (alter)
info: Hold tight, this could take a moment.
info: ✓ Auto-migration complete.
debug: Running v0 bootstrap script... (looks like this is the first time the bootstrap has run on this computer)
info:
info: .-..-.
info:
info: Sails <| .-..-.
info: v1.4.3 |\
info: /|.\
info: / || \
info: ,' |' \
info: .-'.-==|/_--'
info: `--'-------'
info: __---___--___---___--___---___--___
info: ____---___--___---___--___---___--___-__
info:
info: Server lifted in `/opt/foo-app`
info: To shut down Sails, press <CTRL> + C at any time.
info: Read more at https://sailsjs.com/support.
debug: -------------------------------------------------------
debug: :: Wed Jul 21 2021 23:02:10 GMT-0500 (Central Daylight Time)
debug: Environment : development
debug: Port : 1337
debug: -------------------------------------------------------
Notice in this example that port 1337 is being used. If there is a firewall on your system running Sails, ensure port 1337 is allowed in the firewall. Then navigate to http://<ip address or hostname>:1337 and the following should be displayed.
Did you find this article helpful?
If so, consider buying me a coffee over at