Raspberry Pi 3B+ Server localhost:3030 does not work after install Anvil App Server Jar.
Failed to start built-in Postgres database: java.lang.IllegalStateException: Process failed
More logs are available in .anvil-data/postgres.log.
Some common causes of this problem:
Are you launching this server as ‘root’ on a UNIX system?
Postgres will not run as root; try launching the server as an ordinary user.
Are you running this server on an unusual architecture or OS? (Linux/arm)
tail .anvil-data/postgres.log.
initdb: cannot be run as root
Please log in (using, e.g., “su”) as the (unprivileged) user that will
own the server process.
What could be the solution to this?
# Running Anvil apps locally
You can export any Anvil app from the Anvil Editor and run it on your computer using the open-source [Anvil App Server](https://github.com/anvil-works/anvil-runtime).
You can also **build and deploy your apps in Anvil's cloud** -- by far the easiest way to build a web app. Build your app using our [online IDE](https://anvil.works), complete with drag-and-drop UI designer and autocomplete -- then [click one button](https://anvil.works/docs/deployment), and it's live on the web!
Follow this how-to guide to export an Anvil app from the online IDE and run it on your own machine.
All you need to do to run your app locally is:
1. Install the Anvil App Server
2. [Clone an Anvil app onto your local machine with git](https://anvil.works/docs/version-control/git)
3. Launch your app
## Set up your environment
### Dependencies
You will need to install the **Java virtual machine**. On Debian-based Linux systems (like Ubuntu and Raspbian), you can do:
This file has been truncated. show original
I follow this tutorial above and works great … you try
2 Likes
Yes it worked thank you. Needed Java virtual machine . Do you know how to run it as a background service?
1 Like
I create a bash file and it will run everytime i start RaspberryPi … easy
I am a bit new to yaml. Can you please give me a link or bash script to get me started. Tried web search but did not succeed.
#!/bin/bash
cd /home/pi
. env/bin/activate
echo “DONE”
anvil-app-server --app your_app_name
this is what i have in my bash file.
you only need to create an empty file, inside you put that, save … run … and its done
Of course, you need to clone your app from git hub before you do that, to /home/pi
And already create the environment env as you see in the tutorial
you try
##Somehow bash did not work for me so I adopted systemd method.
sudo nano /etc/systemd/system/camera.service
##and inserted the following in the file:
[Unit]
Description=camera service
After=network.target
[Service]
ExecStart=anvil-app-server --app <my_app_name_here>
WorkingDirectory=/home/pi/
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi
[Install]
WantedBy=multi-user.target
##ctrl+x then y then enter to save
##and it worked after doing this on terminal
sudo systemctl enable camera.service
sudo systemctl start camera.service
sudo systemctl daemon-reload
Perfect. Thank you for your assistance
2 Likes