Instagram is probably the most popular photo sharing app allowing you to easily share all your photos to your friends and family. However the TOS have changed quite a lot and you may fear some security, anonymity and ownership concerns to share all your life to this company.
If this the case, few alternatives exists with a strong focus on privacy or even allowing you to run your own instance of Instagram-like on your server to keep full ownership of your pictures. And this is what OwnStaGram is providing.
OwnStaGram is a self-hosted photo sharing-platform, written in PHP and under GPLv3 license. It allows you to upload your pictures to the website or directly with a dedicated Android app, then you can simply share the URL of your pictures to your friends, family, etc…
You can have a look here as an example.
You will need to have a working LAMP server. If it is not the case, please follow this article.
1) Clone the git repository under your /var/www folder
cd /var/www git clone https://github.com/mad5/ownstagram
2) Make sure ownstagram folder is writable
chown -R www-data:www-data /var/www/ownstagram
3) Create a database
I called it ownstagram and created a dedicated user (ownstagram)
4) Import/run the SQL-File “DATABASE.sql”
If you use phpmyadmin, the easiest is to copy the content of the DATABASE.sql to ownstagram–>SQL and run the code.
5) Configure the inc.var.php file
You will need to rename the inc.var.php.dist into inc.var.php
cd ownstagram mv inc.var.php.dist inc.var.php
and insert your database credentials into your inc.var.php
and set the host (localhost probably), user, pass and name.
You will also need to modify the “ownStaGramAdmin” with the email address you want to use as admin user.
Note that you can also set the MailSender, site name and timezone.
When done, simply save the file with CTRL +X (then Y)
6) Register with the admin email address previously created
Simply go to http://yourip/ownstagram and register your admin user, previously set into your inc.var.php file.
When done, it will recognize the admin account and will skip the activation step.
You are now ready to upload photos, add users, create groups, etc… but also to install the android app and to point it to your ownstagram instance.
And if you want to have a more friendly URL, like mygram.domain.tld or even to set up SSL connection, follow below instructions
What you will need:
1) Create a A redirection in your DNS server/registrar with mygram.domain.tld to your IP
2) Have SSL certificate ready. If not you can read this tutorial. (Optional)
3) Create your virtualhost as following:
In /etc/apache2/sites-enabled/, create a file called ownstagram (In root):
and paste the following content:
<VirtualHost *:80> ServerAdmin firstname.lastname@example.org ServerName mygram.domain.tld Redirect / https://mygram.domain.tld </VirtualHost> <IfModule mod_ssl.c> <VirtualHost *:443> SSLEngine on SSLCertificateFile /etc/ssl/certs/myblog.pem SSLCertificateKeyFile /etc/ssl/private/myblog.key ServerAdmin email@example.com ServerName mygram.domain.tld DocumentRoot /var/www/ownstagram <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /var/www/ownstagram> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> </VirtualHost> </IfModule>
Adapt the content (Servername, webmaster, SSL certificate and directory).
When done, save the file (CTRL+X then Yes) and reload apache: (In root)
Now your ownstagram should be fully working will SSL certificate and using a easier to remember URL.