Quicksstart VPS. (Recommended)
This guide is for installion on a digital ocean droplet, linode or ec2 machine. The installation guide assumes your are using Ubuntu 24.04 and LAMP
Step-by-Step Installation Instructions for Memex on a VPS
Prerequisites:
LAMP Stack: Make sure you have a LAMP (Linux, Apache, MySQL, PHP) server setup. This setup includes: (Server Requirements for full list)
Linux (Ubuntu or CentOS, for instance)
Apache web server
MySQL 8.0 database server (or MariaDB, depending on your preference)
PHP 8.2 or later (preferably the latest version compatible with Memex)
Composer and Node.js/NPM installed on your server:
Composer: A dependency manager for PHP, required to install PHP packages.
Node.js and NPM: Node Package Manager, required for frontend assets.\
Detailed Steps: We shall be deploying to a domain "memex.io"
Set Up Your Web Root:
Point your Apache web server’s DocumentRoot to the
public
directory inside your site directory.Example for Apache configuration for memex.io site. replace memex.io with your own domain.
(
/etc/apache2/sites-available/memex.io.conf
):<VirtualHost *:80> ServerName memex.io DocumentRoot /var/www/memex.io/public <Directory /var/www/memex.io/public> AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/memex.io-error.log CustomLog ${APACHE_LOG_DIR}/memex.io-access.log combined </VirtualHost>
After updating this file, enable the site and restart Apache:
sudo a2ensite memex.io.conf sudo systemctl reload apache2
Clone The repo. to you site folder
cd /var/www/ git clone https://github.com/scriptoshi/memex.git memex.io // In apache config above DocumentRoot is /var/www/memex.io
If you cannot clone above, simply download from github and extract the Application Files:
Dowload memex files and Upload the zip your to your
/var/www/
directory.Extract the zip file:
sudo unzip Memex-vps.zip -d /var/www/
Rename the extracted folder to your site name, for example:
sudo mv /var/www/Memex /var/www/memex.io
Navigate to the Site Directory:
Change directory to your newly created site folder:
cd /var/www/memex.io
Install PHP Dependencies:
Run Composer to install the necessary PHP packages:
composer install
This will create a
vendor
directory containing all the required PHP packages.
Set Up Frontend Assets:
Run NPM to build frontend assets:
npm install npm run production
Configure Environment Variables:
rename the
env.example
file to.env
:cp .env.example .env
Update
.env
with your database and other configuration details:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=your_database_name DB_USERNAME=your_database_user DB_PASSWORD=your_database_password #APIKEYS #usdrates api (free apikey https://coincap.io/api-key) COINCAP_APIKEY="55014acc-....-c042809054da" #appkit project id: https://cloud.reown.com/ PROJECT_ID="0908f6dccf.....a07b199620c" ## Ankr apikey https://www.ankr.com/rpc/projects/ ANKR_KEY="601613d5ca8940e....0690e421efc9d81" #ADMIN-ACCESS ADMIN="0xcf01271DC73639843e95C24F7FA3C0b11A1a9B27"
Generate Application Key:
Run the following command to generate a unique application key:
php artisan key:generate
Run Database Migrations and Seeders:
Migrate the database tables and seed initial data:
php artisan migrate --seed
Set Folder Permissions:
Ensure the necessary permissions for the
storage
andbootstrap/cache
directories:sudo chmod -R 775 storage bootstrap/cache sudo chown -R www-data:www-data storage bootstrap/cache
Restart Apache:
Finally, restart Apache to ensure all configurations are correctly applied:
sudo systemctl restart apache2
Access the Site:
Open your browser and navigate to your site’s URL (e.g.,
http://memex.io
). Your site should now be live!
Clean up and fix a few things.
If you are like me , you most likely use root, so some permission maybe messed up. \
# Clean up mkdir -p storage/app/public/uploads/ php artisan clear-compiled php artisan optimize php artisan storage:link sudo chgrp -R www-data storage bootstrap/cache sudo chmod -R ug+rwx storage bootstrap/cache
Open your browser and navigate to your site’s URL (e.g., http://memex.io
). Your site should now be live!
Configure CRON
Option 1: Using Crontab
Open your crontab file:
crontab -u www-data -e
Add this line to run the scheduler every minute:
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
Replace /path-to-your-project
with your project path. (Not the public directory)
Option 2: Using System Crontab
Create a new file in
/etc/cron.d/
:
sudo nano /etc/cron.d/laravel-scheduler
Add the following line:
* * * * * www-data cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
Set proper permissions:
sudo chmod 644 /etc/cron.d/laravel-scheduler
SETUP LARAVEL REVERB.
You need to setup supervisor to run reverb:start. We include a bash script to get you up and running. make sure you are in your site directory. This will rig and start all the supervisor processes needed to get reverb up and running. correctly
#cd to your site directory EG.cd /var/www/memex.com
cd /var/www/memex.io
chmod +x laravel-reverb-setup.sh
sudo bash ./laravel-reverb-setup.sh
Update .env
#update REVERB_HOST with your plain domain.
#Donot add a slash after or http(s). eg scriptoshi.com, memex.website.com etc
REVERB_HOST="scriptoshi.com"
Laravel Queue Workers.
The app users queues for events for Jobs, Events and Notification. Queue workers are monitored by supervisord. We have created bash script that will configure supervisord to monitor your queues. here's how to run it.
#cd to your site directory EG.cd /var/www/memex.io
cd /var/www/memex.io
chmod +x queue-worker-setup.sh
sudo bash./queue-worker-setup.sh
Last updated